Initial Server with Ubuntu 18.04

less than 1 minute read

1. Logging in as Root

ssh root@server_ip

2. Creating a New User

adduser luat

luat is my username (you need to hange to your) You need to type password and some information.

3. Granting Administrative Privileges

To allow my user to run commands with administrative privileges, I add the new user to the sudo group:

usermod -aG sudo luat

4. Setting Up a Basic Firewall

See list UFW profile:

ufw app list

Allow SSH connection after enable ufw firewall:

ufw allow OpenSSH

Enable firewall:

ufw enable

You can see OpenSSH has been allowed by ufw:

ufw status

5. Sync ssh public key from root account

If when create VPS you choose to use SSH key authentication, now you can use rsync to copy .ssh folder to current user:

rsync --archive --chown=luat:luat ~/.ssh /home/luat

Now you can ssh to your server by new user:

ssh luat@server_ip

Comments