• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Configure SSH on server

dawks

Diamond Member
I just got a a Ubuntu 10.04 LTS VPS server and I am trying to secure it some what. I am trying to get SSH setup to NOT use a password and instead use Public and Private keys using putty on Windows.

I've followed this guide (https://help.ubuntu.com/community/SSH/OpenSSH/Keys), but I dont see how to get the key files to my desktop. I see the command ssh-copy-id <username>@<host> but how will that get the file to my Windows Host?

Where would puttygen.exe fit into this? I've generated a strong key with it, but I can't see how to get the key to the server. Also where would I want to store the keyfile on the server? The guide isnt clear.

Linux newb here obviously, but trying to learn!

Is there a better, clearer guide? or can someone break down the steps so I can have a better understanding of the process?

Thanks.
 
The keys you generated are for the client actually. copy id_rsa and id_rsa.pub to your local computer someplace safe. Delete the private key from the server afterwards. Better yet, just delete them both and use puttygen to generate a key on your local machine. Like this:
PuTTYgen-5.png


Log in using a password, create the ~/.ssh directory on the host. Use nano or vi to write the string from your public (see picture where it says "Public key for pasting...") key to .ssh/authorized_keys (all on one line) set the permissions per the guide you cited above for your ~/.ssh directory, and attempt logging in with the key. Once it works you can disable password auth.

Important to note, your private key has no business existing on your server, it is the file specified by the putty client under Connection > SSH > Auth and it will have a *.ppk file extension if you make it with puttygen.

Alternatively, keep the keys you generated on the server, in you .ssh directory enter the command
Code:
 cat id_rsa.pub >> authorized_keys
and bring the id_rsa (private key) to your local machine and import it with puttygen
 
Last edited:
Also, hopefully it is a regular install. I performed the exact advice recommended on another project last year and it would not work because the home directory was encrypted. No /home encryption, and you are good to go.
 
Back
Top