Skip to content

Instantly share code, notes, and snippets.

@gdellicarpini
Created October 30, 2017 15:49
Show Gist options
  • Save gdellicarpini/8920794b367dfb536b724e159aaad9b6 to your computer and use it in GitHub Desktop.
Save gdellicarpini/8920794b367dfb536b724e159aaad9b6 to your computer and use it in GitHub Desktop.
SSH login without password (public-private key)
on server1 logged as root
root@server1: sudo su
root@server1: ssh-keygen -t RSA
root@server1: cd root/.ssh/
//append server1's public key to server2's /root/.ssh/authorized_keys file
root@server1: ssh-copy-id -i id_rsa.pub root@server2
Now you can log into server2 as root without password.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment