Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Shortcut for ssh/Terminal with multiple usernames Apps
If you use different accounts with Terminal's Connect to Server feature (in the File menu, and in the Terminal's contextual Dock menu), you need to fill in the User field to complete connections to your servers. However, you can instead add a server named like this:
remoteuser@example.com
A double-click on that server in the Connect to Server dialog will send the username and host, saving perhaps a bit of time during setup.
    •    
  • Currently 3.33 / 5
  You rated: 5 / 5 (3 votes cast)
 
[6,365 views]  

Shortcut for ssh/Terminal with multiple usernames | 2 comments | Create New Account
Click here to return to the 'Shortcut for ssh/Terminal with multiple usernames' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Shortcut for ssh/Terminal with multiple usernames
Authored by: dergl on Nov 14, '05 07:15:37AM

Instead you could use the .shh/config -file in your home-folder.

Host fooex
  Hostname www.example.com
  User foo

Host barex
  Hostname www.example.com
  User bar

Host rootex
  Hostname www.example.com
  User root

then just type in the console:

ssh fooex
ssh barex
ssh rootex


[ Reply to This | # ]
This works other places too
Authored by: lullabud on Nov 14, '05 09:58:17AM
Although there are plenty of ways to authenticate yourself automatically from the terminal, this method stands out particularly because it's part of the standard url scheme. This will work in Safari, Firefox, command line ftp, ssh, etc, for many different protocols. The extent that I know is that the standard is protocol://[user[:password]@]host/resource. So, for instance, you can bring up the "connect to server" window and type smb://user:pass@windowsbox/share/folder/ and it will connect, though I have seen problems with it being finnicky.

This also works in KDE in linux too when you press F2 or use the location field in Konqueror.) This works with AFP, SMB, HTTP, FTP, and I'm sure a great many others, and in Windows in some applications, such as Firefox.

It's worth noting that not all authentication methods support this scheme. Logging into a site like macosxhints.com won't support that scheme because you're not doing an HTTP-layer authentication.

[ Reply to This | # ]