Starting a new Ubuntu Server Checklist
A small checklist when starting a new server. Just to do not waste time boostrapping tests.
-
Add a new user for the application:
# Pick a strong password adduser username
-
Add a new user to the “sudo” group
gpasswd -a username sudo
-
Logged in as the new user, generate a ssh key pair - usually used for readonly access of a private hosted project so we’re able to fetch and release new versions.
ssh-keygen -t rsa -b 4096
-
Add your local public ssh key (workstation) to the remote server by using ssh-copy-id or by copying it inside the
~username/.ssh/authorized_keys
ssh-copy-id demo@SERVER_IP_ADDRESS
-
Disallow remote SSH access to the root.
sudo vim /etc/ssh/sshd_config # Find for the line: PermitRootLogin yes # and change it to: PermitRootLogin no # Save the file and restart the SSH daemon sudo service ssh restart