LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   SSH config (https://www.linuxquestions.org/questions/linux-server-73/ssh-config-735919/)

noir911 06-26-2009 06:29 PM

SSH config
 
I'm using ~/.ssh/config to ssh to various hosts. I have a different user name that is not in the global settings but is defined in the local setting for that host. If I ssh to that host, I still get the global user name. How can I change this?

My ~/.ssh/config

Code:

# Site-wide defaults for some commonly used default options

Host *
  ForwardX11 yes
  ForwardX11Trusted yes
  ForwardAgent yes
  ForwardX11 yes
  Protocol 2
  Port 22
  User chris
  IdentityFile /home/chris/ssh_keys/chris_ssh_keys
  Compression yes

  Host weldpond
  HostName ssh1.company.tld

  Host rekon
  User ben
  Hostname ssh2.company.tld.

Thanks.

CoderMan 06-26-2009 07:53 PM

Quote:

Originally Posted by noir911 (Post 3587580)
I'm using ~/.ssh/config to ssh to various hosts. I have a different user name that is not in the global settings but is defined in the local setting for that host. If I ssh to that host, I still get the global user name. How can I change this?

My ~/.ssh/config

Code:

# Site-wide defaults for some commonly used default options

Host *
  ForwardX11 yes
  ForwardX11Trusted yes
  ForwardAgent yes
  ForwardX11 yes
  Protocol 2
  Port 22
  User chris
  IdentityFile /home/chris/ssh_keys/chris_ssh_keys
  Compression yes

  Host weldpond
  HostName ssh1.company.tld

  Host rekon
  User ben
  Hostname ssh2.company.tld.

Thanks.

Seems okay, as far as I can tell. Only irregularity I can see is that on the last line you used "Hostname", whereas the man page says "HostName".

You are using the shortcut hostname when you ssh, right? It should be "ssh rekon" in your case.


All times are GMT -5. The time now is 12:55 AM.