Creating a strong SSH key pair for file transfer without a password

Posted by on January 12, 2012 in Operating Systems, Ubuntu | 0 comments

Creating a strong SSH key pair for file transfer without a password

Passwords really get in the way of scripts that have to automatically transfer files. They can also be annoying if you’re logging into the same machine all the time. If you create a key pair between two machines however, the account you created it for won’t have to provide a password when accessing the other machine. Note these are 1 way, meaning if you put computer A’s ssh key on computer B, A can log into B without a password, but B still needs a password to log into A.

Steps to set it up

  1. Create the Key Pair.  Just hit enter for all the options and it will put the files in the .ssh/ folder
    ssh-keygen -t rsa -b 4096
  2. SSH the .pub file to machine B, the machine you want to be able to log into without a password.
    scp .ssh/id_rsa.pub user@192.168.1.B:
  3. Append the contents of the .pub into the .ssh/authorized_keys file of machine B
    cat id_rsa.pub >> .ssh/authorized_keys
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>