Prerequisites for Debian10

Logging in as Root

ssh [email protected]_server_ip

Creating a New User

adduser user1

Granting Administrative Privileges

usermod -aG sudo user1

Setting Up a Basic Firewall

apt update

apt install ufw

You list all available application profiles by typing.

ufw app list

We need to make sure that the firewall allows SSH connections.

ufw allow OpenSSH

Output

[email protected]:~# ufw allow openSSH
Rules updated
Rules updated (v6)

Enable the firewall by typing

ufw enable

Output

[email protected]:~# ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup

You can see that SSH connections are still allowed by typing.

ufw status

Output

[email protected]:~# ufw status
Status: active
To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)

Enabling External Access for Your Regular User

cp -r ~/.ssh /home/user1

chown -R user1:user1 /home/user1/.ssh