Making your server trust your laptop

To avoid copying and pasting my password (mostly in the wrong window), I thought it would be better to make my server trust my laptop by using public/private keys:
Here we go:

For Linux (or BSD, or OSX):

1. Open a terminal on your laptop and generate your keys:

ssh-keygen -t rsa

You may optionally choose a passphrase (which I didn’t since the I want to avoid typing).

2. Copy the public key to your server:

scp ~/.ssh/id_rsa.pub username@server_address:/your/home/folder/

3. SSH into your server and add your public key to the authorized_keys file:

cd ~/.ssh
echo "#Something to identify your key" >> authorized_keys
cat /your/home/folder/id_rsa.pub >> authorized_keys

4. Open another terminal and try logging to your server just providing your username:

ssh username@server_address

You should be granted with the shell command line from your server. If not, please review what you did. If still doesn’t work, drop me a line:

Tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • IGlr