How to Setup and Secure Centos7 Server On Vultr VPS (Vultr Tutorial)

How to Setup and Secure Centos7 Server On Vultr VPS (Vultr Tutorial)



Learn how to setup and secure Centos 7 server on Vultr Cloud VPS. In this tutorial, I will teach everything related to the fundamental of server setup using Centos 7 and Vultr cloud computer such as:

1) Create and setting user privileges
2) Secure your vps using ssh and private keys file
3) Setup basic firewall for your Centos 7 server
4) Create Swap file on Centos
5) Take snapshot of your Vultr VPS

Enjoy the tutorial!…

RECOMMENDED READING:

RECOMMEND VIDEO TUTORIALS:

How to Setup and Secure your VPS on Ubuntu server

Vultr Vs DigitalOcean (VPS review)

How to Install WordPress on Vultr VPS server

HOSTING COUPONS AND FREE CREDITS

Get $50 Free Credit from Vultr Cloud VPS:

Get up to %51 discount from A2 Hosting:

Get 60% Discount from SiteGround Hosting:

Get up 50% Discount from Bluehost Hosting:

Get up to 60% discount from Hostgator Hosting:

THEMES AND PLUGINS

Kleo Multi Purpose Theme

Easy Social Share Button Plugin for WordPress

⚠️COMMANDS USED IN THE TUTORIALS

=====================================
1 Setup user privileges
=====================================

adduser kimseasok

passwd kimseasok

usermod -aG wheel kimseasok

=====================================
2 Generate & Embed SSH Keys
=====================================
mkdir .ssh
chmod .ssh 700

vi .ssh/authorized_keys

chmod 600 .ssh/authorized_keys

sudo vi /etc/ssh/sshd_config

PermitRootLogin no

PasswordAuthentication no

sudo systemctl reload sshd

=====================================
3 Firewall
=====================================

sudo systemctl start firewalld

sudo firewall-cmd –permanent –add-service=ssh

sudo firewall-cmd –permanent –add-service=http

sudo firewall-cmd –permanent –add-service=https

sudo firewall-cmd –permanent –add-service=mysql

sudo firewall-cmd –permanent –add-service=https

sudo firewall-cmd –permanent –add-port=4444/tcp (use port instead of service name)

sudo firewall-cmd –get-services

sudo firewall-cmd –reload

sudo systemctl enable firewalld

=====================================
4 Swap File
=====================================

sudo fallocate -l 8G /swapfile

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

sudo sh -c ‘echo “/swapfile none swap sw 0 0” ⚠️DOUBLE CLOSING ANGLE BRACKETS /etc/fstab’

7 thoughts on “How to Setup and Secure Centos7 Server On Vultr VPS (Vultr Tutorial)

  1. after enable firewall and restart I'm unable to log, its timeout always, omg, i'm searching solution but not able to find

  2. Thx dude! I was very confused about setting up security and this helped me a lot! Quick question do you think changing SSH port is necessary to increase security?

  3. Kim, your videos are EXCELLENT! Very well explained in depth, thank you for your awesome tutorials! keep up the good work. Thank you so much, dear!

Leave a Reply

Your email address will not be published. Required fields are marked *