SSH automatic login assistance script

A while ago I did a write up on SSH keys, anyways I was looking into it a little more today and came across this handy little script that makes it… well simple.  I didn’t write it myself, I found it over here.  Go ahead and give it a try it works like a charm.

# say: ./ hostname
# Uploads your to the specified host, wrapped for readability
if [ ! -r ${HOME}/.ssh/ ]; then
ssh-keygen -b 2048 -t rsa
# Append to the copy on the remote server
cat ~/.ssh/ | ssh ${USER}@ "cat - >> .ssh/authorized_keys"

if [ $? -eq 0 ]; then
echo "Success"