Passwordless SSH log in for MAC OS X

On the machine from you want to ssh to ypur dream server:

  • Create id_rsa key.

when prompted use the suggested filename, and (I strongly recommend to select a passphrase)

ssh-keygen -t rsa

– Copy public key from ~/.ssh/id_rsa.pub to your server using copy-ssh-id

ssh-copy-id -i ~/.ssh/id_rsa.pub myname@myserver.com

Now you should be able to ssh without using password.

 

If you add a passphrase

You will need one more extra step to store the passphrase in the keychain so you won’t be asked to type it over and over again.
– Create a file in ~/.ssh/config
– Add these contents

Host *
AddKeysToAgent yes
UseKeychain yes

 

Now once you enter the passphrase, OS X won`t ask you again.

Leave a Reply