The lines that you will need to enter or customize will be in RED in this guide! The rest should mostly be copy and paste.
When we first begin to access fresh VPS, there are few steps we will be taking to make sure our server is secure. Some of the first tasks required on a VPS (Virtual Private Server) include setting up a new user, providing new user with proper privileges and configuring SSH. So lets begin.
Its not good practice to use root on a VPS on regular basis, We will setup an alternative user that will be used to manage our newly create VPS.
Enter your password that was sent to you in email. For first logon , the system will force you to change “root” password.
For first logon , the system will force you to change “root” password. Enter and confirm New password.
Step-1: Create New Admin User Account:
In my case I will be using “Khanthecomputerguy”
Enter password and user information for newly created User. (Password is required but rest of user information is optional)
Step-2: Set Root Privileges For New User:
As of now, only ROOT has all the administrative rights. Since we will be using our new user as an admin so its very important we give assign administrative rights to this user.
When we perform any root tasks with the new user, we will need to use the phrase “sudo” before the command. “sudo” is helpful command for two reasons. 1: It prevents the user making any system changes that can potentially destroy the system mistakenly. 2) It logs all the commands run with “sudo” to file ‘‘/var/log/secure” which could be reviewed later if needed.
Let’s edit the sudo configuration.
Find the section called user privilege specification.
Add the following line under root ALL=(ALL:ALL) ALL
|demo ALL=(ALL:ALL) ALL|
Press “Ctrl x” to exit file. Y to save modification.
Step-3: Configure SSH:
We need to make sure our server is 100% secured. Although this step is optional but I strongly suggest, it should be implemented on your secure.
These steps are optional. Please keep in mind that changing the port and restricting root login may make logging in future more difficult. So follow each step carefully and please write down the information you will be using here and DO NOT misplace them.
Open the configuration file
Port 25000 Protocol 2 PermitRootLogin no
Port: Although port 22 is the default, you can change this to any number between 1025 and 65536. In my case I changed it to 25000. Make sure you write this new port number. You will need it to log into your server in future.This change will make very difficult for unauthorized people to login to your server.
PermitRootLogin:Change this from yes to no to stop future root login. You will now only be logging on as the new user demo. (In my case khanthecomputerguy)
Press “Ctrl x” to exit file. Y to save modification
Step-4: Reload SSH:
Reload SSH to implement new settings.
!!DO NOT Logout of ROOT Yet!! Instead open a new terminal window and login as new user “Demo” with New port Port “25000″. Just to make sure you are able to connect.
If you followed all the steps properly. You should be able to login with your newer user. This conclude Initial Server Setup with Ubuntu step of our guide.
Continue with Two Domain names >> step.