Linode Forum Index Linode Forum
Linode Community Forums
 


Putty/SSH/public keys - am i on the right track

Click here to go to the original topic

 
       Linode Forum Index -> General Discussion
Author Message
Olori



Joined: 18 Nov 2011
Posts: 3

Posted: Sun Nov 20, 2011 6:21 am    Post subject: Putty/SSH/public keys - am i on the right track  

So 2 days later after googling and compiling a number of different articles together until I can make any sense of it all I have managed to generate a key and copy it to the .ssh/authorized keys file.

So I logged out of putty, that's the console/client I am using and it asks for a login. Do I still log in as root with my new passphrase? or have a missed a step ?
Back to top  
The Other Air Force



Joined: 02 Aug 2011
Posts: 23

Posted: Sun Nov 20, 2011 1:03 pm    Post subject:  

When you generated the key using PuttyGen you have to save the private key somewhere and then specify the filename in the connection setup of putty under SSH -> Auth (don't forget to save the connection details). Then it should work. You said you already copied the public key to the server.

The only thing you'll be asked for at login is the password you specified for the private key if you set one. You'll be logged in as the user that has the public key in their .ssh/authorized_keys file.
Back to top  
jphelps



Joined: 22 Sep 2009
Posts: 3

Posted: Sun Nov 20, 2011 10:53 pm    Post subject:  

Under windows you can also use pagent to cache keys and that has to be allowed in that sessions configuration. Very handy though.
Back to top  
Olori



Joined: 18 Nov 2011
Posts: 3

Posted: Mon Nov 21, 2011 2:33 pm    Post subject:  

The Other Air Force wrote: When you generated the key using PuttyGen you have to save the private key somewhere and then specify the filename in the connection setup of putty under SSH -> Auth (don't forget to save the connection details). Then it should work. You said you already copied the public key to the server.

The only thing you'll be asked for at login is the password you specified for the private key if you set one. You'll be logged in as the user that has the public key in their .ssh/authorized_keys file.



That's what I did, only when I go into Putty, I have to put in a login. I go in as root and then I am asked for the passphrase which I put in. i do get connected but I thought the whole point was not to log in as root
Back to top  
theckman



Joined: 27 Nov 2010
Posts: 45

Posted: Mon Nov 21, 2011 2:50 pm    Post subject:  

You can disable root log ins completely by editing your '/etc/ssh/ssd_config' and finding the "PermitRootLogin" option and set it to "no":

Code: PermitRootLogin no

Or, you could set root logins to only work if you connect via SSH using an SSH pubkey:

Code: PermitRootLogin without-password

After making this change restart SSH:

Code: /etc/init.d/ssh restart

-Tim
Back to top  
Olori



Joined: 18 Nov 2011
Posts: 3

Posted: Wed Nov 23, 2011 6:49 am    Post subject:  

Thanks theckman. i will a do little more research into disable root logins and decide upon which is better
Back to top  
zunzun



Joined: 18 Feb 2005
Posts: 445
Location: Birmingham, Alabama USA

Posted: Thu Nov 24, 2011 7:23 am    Post subject:  

That avatar looks like some kind of creepy inflatable sex toy.

James
Back to top  
hoopycat



Joined: 30 Aug 2008
Posts: 1294
Location: Rochester, New York

Posted: Thu Nov 24, 2011 8:38 am    Post subject:  

I don't know how, but I distinctly heard the sound of a needle skidding off of a record when I read that.
Back to top  
Guspaz



Joined: 26 May 2009
Posts: 1150
Location: Montreal, QC

Posted: Thu Nov 24, 2011 10:10 am    Post subject:  

hoopycat wrote: I don't know how, but I distinctly heard the sound of a needle skidding off of a record when I read that.

Oh, don't pretend you weren't thinking the same thing...
Back to top  
 
       Linode Forum Index -> General Discussion
Page 1 of 1