-1

sorry for the noob question, but I'm struggling to understand how they work.

So far, I've managed to create a id_rsa and id_rsa.pub file, I assume id_rsa.pub is the public key.

I should also mention I am using the hosting services 'OVH'. I have added the public key to the 'My SSH Keys' section.

The thing I can't grasp is how do I use it? Do I need to add the public key to my local windows machine for it to use it?

Thanks

  • 2
    You add your public key on systems where you want to be authenticated (for instance, the OVH server). You keep your private key on your PC (or on any system entirely in your control that you will use to access the other systems). Not too familiar with Windows, but somehow you should designate your private key to software you use to access the OVH server (PuTTY, FileZilla..). – xenoid Jul 21 '17 at 0:33
1

To use keys with ssh, you keep your private key (id_rsa in your case) in ~/.ssh (the .ssh subdirectory of your user's home ~ directory). Don't copy it anywhere else, don't tell it anyone, or you'll compromise it.

You copy the public key (id_rsa.pub) in your case into the ~/.ssh/authorized_keys of the user of the remote computer where you'd like to log in with ssh. This file can contain a list of keys, so edit it if there are already keys in there, or just copy it if it's the first key.

See man ssh for details. (That's the first thing you should have read in the first place).

Note that none of this will somehow "secure the Linux OS". This will just make ssh on your remote computer a bit safer, by using a key pair instead of a password. A password is a lot easier to guess than it is to make a matching key.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.