0

I recently generated a key value pair on my university remote server to create .ssh directory and then I copy pasted contents of my .pub file in .ssh directory on my laptop into the authorized_keys files on the university remote server. I still have to enter my password now, why is it so?

3
  • Does it ask for the password of your ssh user login or does it ask for the password of the private key file? Perhaps you just don't provide your private key correctly - are you using ssh-agent?
    – speakr
    Aug 30, 2012 at 13:38
  • It asks for my password of ssh user login. It's a university server. I don't know if I am using ssh agent. Aug 30, 2012 at 13:39
  • Follow this answer and check if public key auth is working correctly with ssh -v.
    – speakr
    Aug 30, 2012 at 14:04

1 Answer 1

2

Usually the private key is protected by a pass-phrase. This isn't the same as your normal login password but you might have chosen the same value for both.

If you don't want to type in a pass-phrase for each connection, you have two choices

  • secure: use the SSH authentication agent on the laptop.
  • insecure: remove the pass-phrase from the private key.

If you have an empty pass-phrase, but are still prompted for your login password, it is probably because public-key authentication failed. Turn up logging in your ssh client (ssh -v) and check the server's sshd logs.


If you generated the key pair on the server, you wouldn't copy the public key from laptop to server as the file would be generated on the server not laptop.

Wherever you generate the keys, you need the private key on your laptop in the location and format expected by your SSH client software (e.g. PuTTY ssh client uses a different format than OpenSSH ssh client). You need to put the public key on the server in the OpenSSH format and in the appropriate ~/.ssh/authorized_keys file with owner-only permissions

2
  • I know it asks for a paraphrase, I entered nothing. Just enter. What should I do? Aug 30, 2012 at 13:31
  • @snihalani: see updated answer Aug 30, 2012 at 13:39

You must log in to answer this question.

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