I'm running Mac Os Lion and have the following ssh config file:

$ cat /Users/fernando/.ssh/config
Port 123

This should result in ssh connecting always on port 123, no?

Well, what happens is that it still tries to connect on 22:

$ ssh 192.168.0.11 -v
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /Users/fernando/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.0.11 [192.168.0.11] port 22.

Any ideas of why this config is not applied? Is ssh config file cached?

link|improve this question

47% accept rate
feedback

2 Answers

What happens if you add a Host directive to that config file?

Host *
  Port 123
link|improve this answer
Indeed, larsks. "Port 123" is not a valid .ssh/config. From ssh_config man page: "The configuration files contain sections separated by ``Host'' specifications, and that section is only applied for hosts that match one of the patterns given in the specification." – Alex Holst Oct 19 '11 at 20:22
feedback

Try changing ~/.ssh/config to this and see if it works:

Host 192.168.0.11
        Port 123
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.