Skip to main content

I found this post today and it’s GOLD if you’re like me and constantly SSH’ing into multiple servers all over the place!

http://sniptools.com/mac-osx/save-ssh-password-in-terminal

READ IT.

Once you’ve read it, here’s the quick version:

1. Make an alias

2. Save the profile

  • source .profile
  • (optional) edit Terminal to run this on startup

3. Make a cert

  • ssh-keygen (leave pass-phrase empty)
  • scp -P 22 ~/.ssh/id_rsa.pub user@host:~/
  • ssh -p 22 user@host
  • mkdir .ssh
  • cat id_rsa.pub >> ~/.ssh/authorized_keys
  • rm -f id_rsa.pub
  • exit

You can now login to your server by simply typing the letter ‘s’ and hitting return =)