When I offer to create new user, I call it
jack, you can use any other username.
If it's setup of server, you have to disable ssh with root and allow it with a custom user.
First time connection
/sbin/ip -4 addr /sbin/ip -6 addr
Update Linux and add new user
apt update apt upgrade adduser jack usermod -aG sudo jack
sudo apt install -y ufw vim sudo ufw app list sudo ufw allow OpenSSH sudo ufw enable sudo ufw status
Copy SSH keys from root to jack
mkdir /home/jack/.ssh/ cp /root/.ssh/authorized_keys /home/jack/.ssh/ chown -R jack:jack /home/jack/.ssh/ chmod -R 700 /home/jack/.ssh/
Exit SSH connection
Connect to server with new user
If works, disallow ssh connection with root.
sudo vim /etc/ssh/sshd_config
PermitRootLogin line and replace
no and restart sshd daemon. Disconnect yourself with
exit and you won't able to connect with
root, connect with custom user now.
-PermitRootLogin yes +PermitRootLogin no
sudo systemctl restart sshd.service
Change root password