Puttygen copy public key
New Ubuntu servers: first steps – ssh login via certificate and x2go
I am overseas again for a while and I still want to connect to all of my machines in the ever-growing park.
It sums up to: save & test connection with putty, generate key with puttygen, copy public key to ~/.ssh/authorized_keys2 (you can load the private key with puttygen if you can’t get the formatting right and copy from there) and finally adjust putty to use the private key for connecting.Then, I disable login for all users except root (who should have a very long password that you almost never have to type) as described here:
As the original poster there writes, only PasswordAuthentication no Match User root PasswordAuthentication yes works. The file location on Ubuntu was /etc/ssh/sshd_config for me.
SSH login via certificates only
I like to activate this setting on all servers that are directly accessible to the outside world because it makes it that much harder to gain access.First, a certificate needs to be created and authorized to authenticate you. This is explained in detail here:It sums up to: save & test connection with putty, generate key with puttygen, copy public key to ~/.ssh/authorized_keys2 (you can load the private key with puttygen if you can’t get the formatting right and copy from there) and finally adjust putty to use the private key for connecting.Then, I disable login for all users except root (who should have a very long password that you almost never have to type) as described here:
As the original poster there writes, only PasswordAuthentication no Match User root PasswordAuthentication yes works. The file location on Ubuntu was /etc/ssh/sshd_config for me.
x2go
After securing ssh access, I like to add x2go to access an actual desktop on certain servers that pack the necessary power. I had trouble displaying fonts with freenx in the past (probably due to xfce) and VNC can be quite slow. x2go is based upon freenx and it has the options for xfce directly in the (Windows, but probably also other OS) client.- Add the x2go ppa repository: add-apt-repository ppa:x2go/stable
- Update and install. sudo apt-get update sudo apt-get install python-software-properties apt-get install x2goserver x2goserver-xsession