Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Does it matter where I generate my ssh key pair?

Writer Matthew Barrera

Does it matter where I generate my key pair? Where should I store the private key and where should I copy the public key? I am a complete noob on this matter. I do know the private key should be stored somewhere safe.

2 Answers

The public key goes to machines you want to connect to, and the private key goes to machine you want to connect from. This allows you to send the same public key to several machines and, if one of them gets hacked, not to worry about the others. It is most simple to generate a pair on your local machine (the one you use). By default, keys go to .ssh/id_rsa and .ssh/id_rsa.pub.

0

Should be stored locally in ~/.ssh .

Should be transfered to server with ssh-copy-id .

Example ssh-copy-id -i key_name user@server , change name of key, user name, and server name to match your user/server .

See or ssh documentation for details.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy