Accessing git over ssh on a non-standard port

Simple ssh access to a git repo can be sufficient for a small dev team–but what if you’re using a non-standard ssh port?

The solution–do as Linus says. Use ~/.ssh/config.

My config now looks like this:

Host my.servername.org
  Port 1234

Remember that ~/.ssh needs to be 700 (read/write/execute for only the owner), and the files inside are all 600:

$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/*

Related posts:

  1. Secure VNC with ssh port forwarding
    Need to help out a damsel in distress (username “damsel”) sitting on a remote debian/ubuntu box (“remotehost”)? Have you set up ssh on a non-standard port (port 12345) already? Great.......

  • Tilo

    another way to do this is to set up your remote repository that way , e.g.:

    git remote add public ssh://username@node.yourdomain.com:1234/home/username/GIT/Project.git

    (see: http://www.bramschoenmakers.nl/en/node/720 )

  • http://www.fotografiacotidiana.com.br Rafael Lopes

    WONDERFUL !!