4

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.

5
  • 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, 2012 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, 2012 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, 2012 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, 2012 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, 2019 at 20:28

3 Answers 3

2

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 [email protected]'
alias badabing='ssh -Y [email protected]'

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.

6

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."

0
0

I had the same issue. Here's how I resolved it using both the GUI and command line

Through the command line:

putty -l \<username\> -pw \<password\> \<hostname\>

example: putty -l jjasper -pw p@ssw0rd 172.30.10.03

Through the GUI:

  1. Set the username in Connection > Data > Auto-login username
  2. Enter the hostname as usual in Session > Host Name (or IP address)
  3. Click Open

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .