Create a key pair
mack:~ reedobrien$ ssh-keygen -t rsa -f ~/.ssh/id_rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/reedobrien/.ssh/id_rsa.
Your public key has been saved in /Users/reedobrien/.ssh/id_rsa.pub.
The key fingerprint is:
bd:6c:18:e3:1a:46:5f:3d:d9:95:ed:82:6b:ea:6b:ec
Add the public Key to the server where you want to authenticate
mack:~ reedobrien$ scp ~/.ssh/id_rsa.pub username@remoteserver:~/.ssh/id_rsa.pub
mack:~ reedobrien$ ssh -l username remoteserver
password: ********
remoteserver:~ username$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
remoteserver:~ username$ exit
NOTE: There are many more advanced features, configurations, identity management things that can be done not covered here.Test
mack:~ reedobrien$ ssh -l robrien remoteserver
Last login: Mon Aug 13 22:28:10 2007 from 131.182.85.5
Welcome to A Better World!
remoteserver:~ robrien$
No comments:
Post a Comment