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.

  • I think you are answering your own question, clearly it does have a different syntax since your usual one does not work :). Why in the world would you want to use putty for linux? Why not just ssh directly?
    – terdon
    Dec 2 '12 at 13:39
  • @terdon The syntax differs using the command line. I'm referring to the GUI, which should also have an option to set the username.
    – AndyCNX
    Dec 2 '12 at 19:46
  • I realize that but if the windows syntax does not work then the linux one must be different. Seriously though, why do you want putty on linux? What does it offer over normal ssh? You can simply open a terminal and type ssh user@host.
    – terdon
    Dec 2 '12 at 20:06
  • Fair enough question. I'm switching from Windows to doing my dev work in a Linux VM. I guess I was just sticking to solutions I'm used to as part of my usual workflow. Just one less thing to figure out for when I need to setup port forwarding or something. I have started using ssh and zssh now instead.
    – AndyCNX
    Dec 3 '12 at 9:18
  • I also want/wanted to do the same because of the same reason so the question itself was so valid even if it is strange for experienced linux desktop users :) (I have also considered to use simply just ssh command but you know, habits)
    – Halacs
    Dec 27 '19 at 20:28

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@'

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.


Maybe previous versions of PuTTY on Linux didn't allow this, but version 0.63 lets you specify a username in the Connection section of the initial configuration dialog.

Conection -> Data -> "Auto-login username"

You can save it under "Saved Sessions."


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.