Created
March 1, 2014 14:32
-
-
Save zilongshanren/9290567 to your computer and use it in GitHub Desktop.
use ssh key to login a server without a password prompt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.use the root user and passwd to login the remote server | |
2.ssh-keygen -t rsa | |
3.scp [-p port] ~/.ssh/id_rsa.pub yourremoteserver:/tmp | |
4.switch to the server | |
5.touch ~/.ssh/authorized_keys | |
6.cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys | |
7.reload ssh | |
8.quit your server and run ssh [-p port] user@remoteserver | |
Reference: http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment