SSH login without password using OS X

Lately, I need to deal with more login combinations. And, most of them are about logging in to server via SSH. I decided to create a simple mechanism rather than having some login combinations written somewhere. Why not remember those logins? Well, too many things to remember.
So, I tried to create an automated system to servers and found this useful tutorial. I tried it on my Mac OS X Snow Leopard, and it works. I put it here for my reference:

  • From Terminal, run: ssh-keygen -t rsa
  • Copy/add ~/.ssh/authorized_keys:
    • If exist:  cat ~/.ssh/id_rsa.pub | ssh username@example.com "cat - >> ~/.ssh/authorized_keys"
    • If not exist: scp ~/.ssh/id_rsa.pub username@example.com:~/.ssh/authorized_keys

Done!

Published
Tagged

2 comments

  1. Although it is very convenient and may seem secure, anyone that could get a copy of your private key would have access to anything “protected” by your key pair. No passwords required.
    A better approach is to use ssh-agent. it’s built in on many modern systems with ssh, including Macs (since Leopard).
    In addition to using ssh-agent, I would also recommend using something like 1Password to manage various logins and identities. No more reusing the same password for everything.

Comments are closed.