1. Generate your keys
ssh-keygen -t rsa -C "[email protected]"
2. Copy public key to authorized_keys
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
3. Chmod
[sourcecode language="plain"]
chmod 700 ~/ssh
chmod 600 ~/ssh/id_rsa.pub
chmod 600 ~/ssh/authorized_keys
[/sourcecode]
4. Enable key authentication in sshd_config
-open up sshd_config (root)
nano /etc/ssh/sshd_config
-uncomment (remove the #) these lines in /etc/ssh/ssdh_config and write the changes
#RSAAuthentication yes
#PubkeyAuthentication yes
-restart the sshd service
service sshd restart
-put your private key in your other environment and test it
ssh yourserver.tld -i ~/.ssh/id_rsa

Similar Posts