Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have generated rsa key and add it to server's ~/.ssh/authored_keys.

why i nedd password when i ssh server?

my local name is A and server name is B(a root user).do i need create a user named A?

share|improve this question
It's not entirely clear to me from your whether you're being asked for the RSA key's passphrase or for the password for the remote user. Being asked for the passphrase (once per session) is entirely usual. – RAOF Dec 21 '12 at 6:32
password, not passphrase – jungledrum Dec 21 '12 at 8:02
up vote 1 down vote accepted

Although the question is not entirely clear, I suspect that the answer is that you've authorised the key for the wrong user.

When you say you added the key to ~/.ssh/authorized_keys that means the key is valid only to log in for that user (whichever it may have been). So, if you were logged in as userA that means that key will be used only if you try and log in as userA again, but won't be used if you try and log in as userB.

By default ssh will log you in as the remote user with the same name as your local user. So, if you're logged in to the local system as userA, ssh will try to log you in to the remote system as userA. If you need to log in as userB you can use ssh rather than ssh

share|improve this answer
thank you!I create userA on server,it's ok.I don't know why.But I want log in as userB. – jungledrum Dec 21 '12 at 8:03
Then use ssh rather than ssh, as I said? Or you can set the default remote user for that server in ssh_config. – RAOF Dec 21 '12 at 9:20

You need password to Unlock generated keys. It requires only first time when you want use SSH. Then for a specific session no need to enter password.

(from man pages)

When the user logs in, the ssh program tells the server which key pair it would like to use for authentication. The server checks if this key is permitted, and if so, sends the user (actually the ssh program running on behalf of the user) a challenge, a random number, encrypted by the user's public key. The challenge can only be decrypted using the proper private key. The user's client then decrypts the challenge using the private key, proving that he/she knows the private key but without disclosing it to the server.

share|improve this answer
every time ,not first time.:-) – jungledrum Dec 21 '12 at 5:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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