Published Oct 17, 2017
Configure your instance to have Ubuntu 16.04 fresh installed. Then connect through SSH to your instance (credentials given by mail after OS installation.)
Create the new user by executing and fill the configuration :
root@your-instance:~# adduser username
Add the user to the sudoers
:
root@your-instance:~# adduser username sudo
(optionnal) Prevent the new user to type his email when he wants to switch to root
root@your-instance:~# echo 'username ALL=NOPASSWD: ALL' >> /etc/sudoers
Try to connect with your username then try to switch to root
username@your-instance:~$ sudo su -
# Type your password if you need to (if you pass step 3)
# You should see
root@your-instance:~#
Next steps will use SSH through username
.
Keep yourself updated : sudo apt-get update
and sudo apt-get upgrade
(you should see nothing because fresh install keeps updated).
sudo apt-get install ufw
Check available connections : sudo ufw app list
, which should render :
Available applications:
Bind9
OpenSSH
sudo ufw allow OpenSSH
sudo ufw enable
Check configuration sudo ufw status
, which should render :
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Install packages :
sudo apt-get install nginx
sudo ufw allow "Nginx HTTP"
sudo ufw reload
Check the status : sudo ufw status
which should render :
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
Nginx HTTP ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Nginx HTTP (v6) ALLOW Anywhere (v6)
Access your web server with your favorite browser : http://your-instance/, which should render :