Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

up vote 7 down vote accepted

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

Host *
  Port 123
share|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
add comment

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

Host 192.168.0.11
        Port 123
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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