The script automatically pushes your SSH private key to the server specified so you can have automatic SSH,scp and sftp authentication. If you don't have a key the script will generate one for you, also this script assumes that the user running the script has a home directory on the remote host. Should note that this script will only push the RSA encrypted key. SSH Automatic login is further described in the document SSH Hardening and Authorized Keys.

The Script

# 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}@$1 "cat - >> .ssh/authorized_keys"

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