LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-26-2009, 06:29 PM   #1
noir911
Member
 
Registered: Apr 2004
Posts: 682

Rep: Reputation: Disabled
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.

Last edited by noir911; 06-26-2009 at 07:24 PM.
 
Old 06-26-2009, 07:53 PM   #2
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
Quote:
Originally Posted by noir911 View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH config for SFTP crispyleif Linux - Server 7 12-18-2008 07:07 AM
SSH config on OpenSuse 10.2 andy.l SUSE / openSUSE 3 04-23-2007 05:32 PM
X over ssh: config questions yocompia Linux - Networking 3 09-19-2003 09:28 AM
SSH config error ImAnEwBiE Linux - Newbie 3 08-11-2003 03:44 AM
/etc/ssh/ssh.config jeffpoulsen Linux - Software 2 04-24-2003 07:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration