JavaScript Linux PHP All
Up

Search



Manage Your Own Linux Virtual Server - Part 2






Recent




PHP MySQL Pagination

PHP MySQL pagination is used to partition the data from the database to navigate the webpage easier and faster....


Get Your Own Virtual Server Hosting

Virtual servers are widely used to host websites due to the great features they provide and the cheap costs....


PHP Database Connection

By having a PHP database connection for your program, it will be easy to append and retrieve records and save the statuses of your program....


Detailed Example Of A JavaScript Object Oriented Code

Learn how to use the properties and methods in the object oriented code and how to call the methods from inside and outside the mother object....


Create A JavaScript Object Oriented Code

By having a JavaScript object oriented code, your program will be more clear and well structured....


How To Use VPS Servers


How To Use VPS Servers
1321   linux

You will learn how to use VPS servers correctly via the commands without the need of any interface or control panel.



In the previous article, we discussed how to buy your own VPS server and how to deploy the Linux environment and get it ready to use. In this article, we will explain in clear details how to use VPS servers and connect to your Linux environment via the terminal using the important Linux commands without the need of any panel or interface to use. You will use the VPS hosting company control panel just to reset your Linux operating system password in case you forgot it or to power on your server after you power it off.


Login To Your VPS Server For The First Time

After deploying your Linux operating system, you will receive the root password immediately via your email in case you didn't select the SSH keys option to login for first time. Below is the email which has just been received after deploying a new droplet.


VPS Server Password Received Via Email

Access VPS Server Via PuTTY For Windows Machines

If you are using Windows Machine, then install PuTTY for Windows, it is very light and easy, open it after the download and add the IP address in the "Host Name" field and make sure that you have the same configuration as marked in the red squares. Click on open (in green square) to establish the connection with the server.


Connect To VPS Server Via PuTTY

Access VPS Server Via Terminal For Linux/Mac Machines

For Linux/Mac machines, we don't need PuTTY as their operating systems have a built-in terminal which allows you to connect to servers remotely. Open the terminal and login to server via the command:


ssh root@192.241.187.61


First Time Connection

Once you establish the connection with the server for the first time (from Windows machine or Linux/Mac machine), you will get a security alert to indicate that your server key is not cached in the registry. Click on "Yes".


Security Alert For First Time Login To VPS Server

After you confirm and click on "Yes", you will be prompted to enter the username and the password for your VPS which has been received in the email. Enter root as a username then hit "Enter" key. Now for the password, if you are using PuTTY, then copy it from the email then paste it by a single mouse right click (you will not see anything when you enter the password).


Console Login To VPS Server

After entering the correct username and password, you will be prompted to change the default password you received in the email. First, enter the default (current) password.


Change The Linux VPS Server Password For First Time Login

After you enter the current password, you will be prompted to enter your new password twice. Your new password must not be simple, the new distributions of Linux operating system don't allow simple password to secure your server, it is better to have a combination of lower/upper case characters with numbers. Hit "Enter" when you finish and you are done!


Enter Your VPS Server New Password Twice

Next Time Connection

Next time you connect to your VPS server, you will not get the security alert and also will not be prompted to change the password, hence dealing with the VPS server will be easier.



View Directories

To view the root directories of your server, you will need to use the command ls which stands for "list" as below.


ls /

View Your VPS Linux Server Root Directories

You can view the sub directories by indicating their names after the slash. Let's now view the content of the subdirectory etc, you will see lot of folders and files inside! Notice that the white color indicates a file while the blue color indicates a folder that might contain folders and files.


ls /etc

View Your VPS Linux Server Subirectories

Create Directories

Creating directories is simple, it is done via the command mkdir which stands for make directory. You can create directories inside directories but you need first to be inside the parent directory which you plan to create a child directory inside it, for this purpose, we will use the command cd which stands for change directory.


Enter A Directory

Let's now go into the directory home which is located on the root and then create the directory innerDirectory1 inside it.

To enter the home directory, use the command cd followed by the directory name as below:


cd /home

Enter A Linux Directory

Let's now create our new directory inside the home directory:

mkdir innerDirectory1

We can verify that our directory has been created by using the ls command to see our directory in blue color inside the home directory.


Create A Linux Directory

We can enter inside the new directory same way as we did with the home directory.


Enter An Inner Linux Directory

Leave A Directory

To leave a directory, we also use the command cd. To go back to the previous directory, add space followed by .. after cd as below:


cd ..

The above command will return us back to the home directory (we went back only for one level).


Go Back To The Previous Linux Directory

If you want to leave all nested directories at once, you can use the pure command cd without any prefix as below:


Leave All Nested Linux Directories

Notice that we returned back to the root directory (base directory).



Reboot & Power-Off Your VPS Server

You can easily reboot or power-off your server via the commands:


reboot

poweroff

Notice that when you power-off your server, you need to go to Digital Ocean website to power it on again by clicking on the button Power On inside the green square as seen below.


Power On Your Linux VPS Server

If you are able to apply all the steps mentioned above, then you know how to use VPS servers correctly, i.e. you got the important skills to access and manage your new server. In the next articles, you will gain more advance skills that you will use to add/remove programs and modules and manage the whole Linux operating system.













Home · About · Contact · Terms · Company Website

· · · ·