Essential steps if you're configuring your server manually. If you are looking for something a little more automated, check out my Ansible playbook tailored for Ruby on Rails hosts. This tip is basically the same as the common role there.
Do this after installing Ubuntu 12.04 LTS. I am assuming you've installed Ubuntu via a console session, have created a user account for yourself during that process and you've chosen to have unattended security upgrades there.
vi /etc/ssh/sshd_config PermitRootLogin no PubkeyAuthentication yes PasswordAuthentication no
Keep your SSH connection open. Do not restart sshd yet.
on your local machine
Place the contents of that file (it's your public key) into
~/.ssh/authorized_keys on the remote host.
Now SSH into the host with a new terminal window. It should not ask for a password.
did it work?
service ssh restart
From now on, log into the host as yourself and use sudo if you need to be root.
$ sudo apt-get update $ sudo apt-get upgrade
get the firewall going
$ sudo ufw default deny $ sudo ufw limit ssh $ sudo ufw allow http $ sudo ufw allow https
add any other service you want exposed
$ sudo ufw enable