DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Public Key Authentication

06.11.2006
| 1661 views |
  • submit to reddit
        The 'key' here is the chmodding... OpenSSH requires proper permissions!

ssh-keygen -t rsa -b 2048

scp .ssh/id_rsa.pub user@remote.box:~
ssh user@remote.box
chmod 700 .ssh
cat id_rsa.pub >> .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
rm id_rsa.pub