I have an ssh config file that looks like this:
Host my.host.com HostName my.host.com User michael Port 1234 If I type "ssh my.host.com" at the command line, it correctly connects to "my.host.com" with the correct user name and non-standard port.
The actual name of the host is quite a bit of typing, so it occurred to me that I could save a lot of typing by creating a host with a shortened name, so I copied the above working section and created a shorter host name:
Host m HostName my.host.com User michael Port 1234 But when I try to connect, I get an error:
ssh: Could not resolve hostname m: Name or service not known I tried it with -v and got no useful information:
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /root/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * ssh: Could not resolve hostname m: Name or service not known I tried adding more -vs to see if it would give more verbose output, but no additional info was shown.
I tried running with -v with another alias I have set up for a different host, and got:
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /root/.ssh/config debug1: /root/.ssh/config line 11: Applying options for z So it appears that, for whatever reason, ssh is ignoring my options for host "m" but not for host "z". The only difference between the hosts that seems potentially relevant is the "z" is elsewhere on the Internet, while "m" is on the LAN, What's going on here?
My first thought was maybe I had to restart something for the changes to take effect, but this is ssh, not sshd.
/root/.ssh/configand not another user's$HOME/.ssh/config? I agree that no restart should be needed.