Skip to content

Instantly share code, notes, and snippets.

@zilongshanren
Created March 1, 2014 14:32
Show Gist options
  • Save zilongshanren/9290567 to your computer and use it in GitHub Desktop.
Save zilongshanren/9290567 to your computer and use it in GitHub Desktop.
use ssh key to login a server without a password prompt
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