| Create Public/Private 4096 Bit SSH RSA Keys |
|
|
|
| Tech Notes - Linux |
| Written by Rick |
| Monday, 28 July 2008 17:43 |
|
To automate SSH login, a copy of the public key representing your system must be placed on the remote computer. These key are typically located in ~/.ssh/authorized_keys. Use the following command to create the keys in your local user directory; ssh-keygen -t rsa -b 4096 -f $HOME/$HOST-rsync-key After creating the key either upload "-rsync-key.pub" file to the remote system's, root user's /.ssh directory. If the file "authorized_keys" does not exists simply rename the file you've uploaded to "authorized_keys", otherwise append the content of the rsync-key.pub to "authorized_keys" and delete the original file. Now you can login to the remote machine without being prompted for a password using the following command: ssh -i $HOST-rsync-key remoteuser@remotehost Remember to check the permissions on "authorized_keys" and set them to 700. Also NEVER distribute the private key to ANYONE and maintain strict control of where you place your public key. Note: If you reinstall your operating system the key data will change requiring your to recreate rsa keys and redistribute.
|




