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?
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?
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 [email protected]
rather than ssh my.server.net
.
ssh [email protected]
rather than ssh my.server.net
, as I said? Or you can set the default remote user for that server in ssh_config.
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.