Linux – Putty on Linux not working with username in host name field

linux-mintputtyssh

I'm setting up a VM based Linux Mint 14 Cinnamon dev env and just installed putty to connect to my Ubuntu servers. Problem is that when I try to use "username@hostname" or "username@ip" (no quotes obviously) then I get the error "Unable to open connection to username@hostname: Name or service not known".

If I use just the hostname or IP it connects fine – it asks for the username and then correctly logs in using my private key.

On my Windows 8 host machine I use "username@hostname" in Putty's Host Name field and it works flawlessly.

Does the Linux putty use a different syntax in the host name field? I checked around but couldn't find anything.

Best Answer

It does look like you can't specify a username in the putty GUI. However, you do not need to use putty if what you want to do is connect to other linux hosts over ssh. Just open a terminal and type:

ssh user@host

This will do exactly what putty does for you in windows.

If you want putty in order to save connections, add lines like the following into your ~/.bashrc file (the following are adapted from mine):

alias myserver='ssh myuser@myserver'
alias petitbonum='ssh bob@petitbonum' 
alias docpad='ssh terdon@docpad.local'
alias badabing='ssh -Y lacoloc@1.2.3.4'

Obviously, change the user and server names and/or IPs to whatever you need. Then, you open a new terminal and type, for example, myserver and hit enter. This will run the command defined in the alias you placed in .bashrc.

Related Question