SSH key exchange

SSH key exchange

Posted By: pmietlicki

Published to Linux on Jun 04, 2015

All the commands are client side

ssh-keygen -t rsa

Then enter, use a passphrase if you want but you'll then have to install and configure ssh-agent.

This command will generate id_rsa and inside the .ssh folder of your user. These are mandatory, please double check you are using the right user ie the one you are currently connected to (don't confuse the root user with the default system user).

ssh-copy-id root@srvwhereyouwantoconnectwithoutpassword

Basically this command will copy the content of inside the authorized_keys on the server side.

That's it ! You should now be able to connect using your key without any password :

ssh root@srvwhereyouwantoconnectwithoutpassword

If you have a connection problem, please double check the rights

Server side

chmod 700 .ssh chmod 600 .ssh/authorized_keys

Client side

chmod 700 .ssh chmod 600 .ssh/id_rsa 

Tags: SSH