Putty/SSH/public keys - am i on the right track
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 ?
8 Replies
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.
@The Other Air Force:
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
PermitRootLogin no
Or, you could set root logins to only work if you connect via SSH using an SSH pubkey:
PermitRootLogin without-password
After making this change restart SSH:
/etc/init.d/ssh restart
-Tim
James
@hoopycat:
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…