BLOG

Increase VPS server's security

Most virtual private server (VPS) providers give machines with root access remotely.

A virtual private server (VPS) is a virtual machine sold as a service by an Internet hosting service. The term "virtual dedicated server" (VDS) also has a similar meaning.
A virtual private server runs its own copy of an operating system (OS), and customers may have superuser-level access to that operating system instance, so they can install almost any software that runs on that OS.
Wikipedia.

 

Let's start setting up.
 

Remove root password:

sudo passwd -d root

 

Disable login by SSH with root user. Edit /etc/ssh/sshd_config file, find and set PermitRootLogin value to no:

PermitRootLogin no

 

Now restart sshd service:

sudo systemctl restart sshd.service

 

Disable ipv6. Add in bottom of /etc/sysctl.conf file following lines:

net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

 

Apply changes without restart system:

sudo sysctl -p

Top button