Tuesday, August 3, 2010

ssh access using public and private keys


  1. Generate a key pair on your machine:

    $ ssh-keygen

    Enter the name of the files with the keys and passphrase (not necessary).

  2. Add your public key to the list of authorized keys on the remote machine:


    cat ~/.ssh/id_rsa.pub | ssh user@machine "cat >> ~/.ssh/authorized_keys"

  3. Set permissions on the remote machine:


    chmod 700 ~/.ssh

    chmod 600 ~/.ssh/authorized_keys


No comments:

Post a Comment