Securing your VPS

No matter what your choice is in terms of web hosting, security should be a top priority. You can maybe get away with using a server that has less than 100% uptime or doesn’t perform at an optimal level all the time, but you can never get away with using a server that is not properly secured. The reason is simple: unsecured machines are always more vulnerable to cyber-attacks, and the risk of data loss and/or leakage shouldn’t be a part of anyone’s business plan.

Different server types require different security strategies.When running a VPS, it can be risky not to go through some basic security measures before using it. So here are a few tips that can guide you in the process of securing your Virtual Private Server:

SSH passwords

Firstly, make sure to have a secure SSH login password for all your accounts. It goes without saying that you shouldn’t use anything that would be obvious or can be easily guessed. For added security, use a random password generator to produce an entirely random sequence of letters and numbers. You can change your SSH password by entering the following command:

passwd

Non-root users

Next, it’s a good security practice to try to run services as a non-root user if possible. You can create new non-root users with this command:

useradd username 

And then set a new password by typing in this command:

passwd username

SSH ports

It’s also recommended that you change the default port of your SSH service. The default is port 22, and you should set it to a different port via the config file for your SSH service.

Firewall

To restrict certain ports or IPs,  and firewall your server against basic network attacks, use iptables. This can take some time so set up, so be patient and research thoroughly. All your efforts will eventually pay off.

 

Leave a Reply