General OS Hardening (Ubuntu 20.04 LTS)
Patching Software
Making New User
You will disable the root user becasue you have sudo
Add that user to sudo group
Change the logged root to create an account
Check to see if your user is part of sudo group
If it returns root you now have sudo privlages
Now move the root account and log out of ssh. Log back in with the created user account.
Locking root
Remove the root account from logging to ssh
Find "PermitRootLogin" and change to "PermitRootLogin no"
Save and exit
Now restart ssh
Make sure if you try to log in with root again you get "permission denied"
Change ssh port and lockout policy
Check if firewall is enabled
Type in this if it is active
If you changed the port add this one too
Now change the port
Uncomment these lines and type in
You can change the max tries if need be. If the password is wrong more than 5 times it will lock out you IP address
Save and Exit
Restart ssh
To log back in you need to
SSH Settings
First thing you are going to enable is Protocol 2
Timeout Idle value
If you're AFK while connected to ssh there could be an issue. You can decrease or increase the time you can be idle.
Last updated
Was this helpful?