Secure your Ubuntu 10.04 server
Login with putty or any other ssh client as root with your assigned password
ssh root@173.203.206.78
You can change your root password if you need to with the following command:
passwdAdd your own user:
adduser jdoe
If you want that sudo su command not to ask for a password:
visudo
Add the following line at the end of the file
jdoe ALL=NOPASSWD: ALLI am logging in from Windows so I used Putty and Puttygen to create a new PPK key in order to log in Issue the following commands:
mkdir /home/jdoe/.ssh
Add the public key into your authorized_keys file:
vi /home/vlad/.ssh/authorized_keys
Secure the files:
chown -R jdoe:jdoe /home/jdoe/.ssh chmod 700 /home/jdoe/.ssh chmod 600 /home/jdoe/.ssh/authorized_keys
Now you have to configure the SSH Daemon:
vi /etc/ssh/sshd_config
And change the following lines:
Port 22222 PermitRootLogin no PasswordAuthentication no X11Forwarding no UsePAM no UseDNS no AllowUsers jdoe
Also make sure that AuthorizedKeysFile %h/.ssh/authorized_keys is uncommented
Restart your sshd service or your server.
sudo /etc/init.d/sshd restart
That concludes the SSH configuration for a password-less log in to your VPS.



