blog posts

How To Set Up A Cloud Server For Our Business?

How To Set Up A Cloud Server For Our Business?

Cloud Infrastructure Has Become One Of The Important Requirements Of The Technology World, So Large Companies Use Cloud Infrastructure In Various Ways To Carry Out Their Activities. 

One of the critical cloud infrastructure services that companies widely use is the cloud server. By providing a robust solution, the cloud server allows companies to use the functions of the physical server optimally.

In this article, we will learn how to build a cloud server.

What is a cloud server?

Cloud server (IaSS) refers to a collection of one or more physical servers that are managed in such a way that they provide functionality similar to a single server and perform tasks such as storing and processing information. Cloud servers are often used to store data.

The Cloud server infrastructure consists of powerful resources that enable the processing and storing data, applications, information, and websites. This infrastructure may be wholly virtual or physical. This infrastructure divides one or more real servers into several virtual layers using special cloud software. These layers and virtual machines can act as separate virtual servers.

These servers provide exceptional facilities and capabilities so that users can access all the features provided through the Internet and user interface. Many companies use XaaS components, such as IaaS (Infrastructure as a Service), to process large workloads or store data. It should be explained that cloud servers are IaaS-based models.

Cloud servers based on virtualization technology can divide physical servers into several (logical) servers. In this case, users in different geographical locations can access their data through the Internet. Virtualization divides a physical server into independent units called virtual machines through a hypervisor program.

Using cloud servers means you no longer need to worry about building or maintaining physical hardware. In addition, cloud servers are flexible and scalable, and their setup process is not particularly complicated.

These virtual machines, which are different from physical computers, have their operating system, memory, and storage space and are entirely separate from each other. You can use any virtual machine for specific applications such as website hosting, applications, or data storage.

How to set up a cloud server?

The first step to building a cloud server is to assess the needs and choose a server that suits your business needs. This step is crucial because if the business needs are not correctly identified, you may end up with more or fewer servers. Another issue that you should pay attention to is the different operating systems that can be deployed on cloud servers, which we will mention below. The process of setting up a cloud server is as follows:

1- Find a cloud service provider

Today, various domestic and foreign companies are engaged in providing cloud infrastructure. By comparing each offer’s prices and capabilities, you can easily find a good service provider. Typically, low-cost cloud solutions offer less service and basic service security.

Hence, you should first define the business requirements that you expect from the cloud server and then look for a provider that offers the desired services. Sometimes, companies need more complex services such as email or file storage. In this case, you should turn to professional cloud service providers.

2- Enter the control panel

After choosing a cloud service provider, the first thing you need to do to set up a cloud server is to log into the control panel. Some providers provide an access key or API login to create your server, but most require users to log in to the control panel with a username and password.

3- Select the cloud server

When you log into the cloud service provider’s control panel, a list of available cloud services will be displayed. Select the desired server type and click the register to start the cloud server setup process. Next, the control panel provides basic information about the cloud server, such as the server name, physical location, and operating system. Some cloud service providers may provide information about cloud server storage and features.

4- Naming the cloud server

Most cloud service providers allow you to choose the operating system and server name during the server setup process. It is better to choose a unique name for each server because if you do not do this, there may already be a server with the same name, and due to the name similarity, some settings will be changed during installation. After installation, you must create a shared folder to store data and files. Cloud service providers provide their customers with various desktop programs such as Microsoft Office, SharePoint, Adobe, and similar examples.

5- Cloud server configuration

Once you have installed the desired operating system and created the cloud server, the next step is to configure it. The first thing network experts do when setting up a cloud server is to set up a private network that will be used to connect systems to the cloud server. When setting up a cloud server, you need to configure the server access key and information about the private network, such as IP address, netmask, etc. Next, you should install a firewall or proxy server to protect your private network from threats and hackers.

6- Setting up a cloud server with Ubuntu 18.04

Now that we have the basic information about the cloud server, it’s time to explain how to set up and install the operating system on the cloud server. In this article, we have chosen Ubuntu 18.04 operating system. Ubuntu is developed based on the Linux kernel and is one of the most stable and best Linux distributions. An important thing to note is that you need to perform some configuration steps as part of the initial server setup to increase the security of the cloud server and simplify its management.

7- Login as the Root user

Linux operating systems that are newly installed on servers have only one root user account. The account you must use to log in to the server for the first time. The root user is a particular user with extensive access to various parts of the operating system.

Due to the extensive access of this user account to different parts of the operating system, it is not a good thing to use it constantly because changes may be unintentionally made to the operating system, which may cause problems with its performance or security.

For this reason, network experts suggest defining a standard user account with legal permissions and privileges (sudo) to enable the execution of specific administrative commands. In the following steps, more powers can be defined for this user account if more access is needed.

To start, you need to log in to the server. For this purpose, you must have the public IP address of the server.

For authentication, if you have set up an SSH key on the server, you need the account password or SSH private key to access the main user account. If this is the first time you are going to log in to the server, log in as the root user with the following command:

ssh root@your_server_ip

If you see a message about host authentication, accept it. You must enter the root password to log in when using a password-based authentication mechanism. If you use an SSH key known as password protected, you will be prompted to enter the password you used during the first session. Also, if this is the first time you log into the server using this password, you will be prompted to change the root password. In the next step, you must create a user account with minimum privileges to run administrative commands via sudo.

8- Creating a new user account

Once you are logged in as the root user, you can create a new user account to log in to the server as a regular user. The following code creates a new user named Sammy, which you can replace with any username of your choice:

asked Sammy

At this stage, you have to answer the questions asked by the operating system. These questions start by choosing the user password. Choose a strong password and enter information in the optional fields if desired. In the optional fields, you can go to the following area without completing each area by pressing the enter button.

9- Granting special privileges to new users

You now have a new user account with standard privileges that sometimes need to manage servers, edit configuration files, or restart the server. To avoid having to log out of the standard user account and log back into the server with the root user account to perform administrative tasks, you can set up a superuser with some root access for the standard version.

This solution allows the average user to have the ability to execute administrative commands by placing the word sudo at the beginning of each order. By default, in Ubuntu 18.04, users who belong to the sudo group are allowed to use the sudo command. To add these privileges to a new user, you must add the user account to the sudo group.

The following command changes the user’s default settings, such as the sudo group, to the list of groups that the user has been a member of in the past. The -G argument tells the user mod to change the user’s group settings. As root, run this command to add your new user to the sudo group. Pay attention; instead of the word Sammy; you must put the name of the created user:

usermod -aG sudo sammy

10- Setting the basic firewall

To ensure that the Ubuntu 18.04 operating system installed on the server can communicate with the outside world, you must properly configure the firewall you intend to install on the operating system. Our suggestion is to use the UFW firewall.

UWF firewall is a firewall configuration tool that comes with Ubuntu servers. Once you have installed applications on the operating system, it is possible to add their profiles to UWF. These profiles allow UWF to manage each program by its name. OpenSSH is a service that will enable you to connect to a server and has a profile registered in UWF. Run the following command to see a list of all currently available profiles:

ufw app list

The output of the above command is as follows:

Available applications:

OpenSSH

To ensure that the firewall allows SSH connections to communicate with the server, run the following command to allow connections:

ufw allow OpenSSH

Next, activate the firewall using the following command:

ufw enable

At this point, type the y key and press enter. Next, run the following command to make sure SSH connections are allowed by the firewall:

ufw status

The output of the above command is as follows:

Status: Active

To                         Action         From

—                      ——          ——

OpenSSH            ALLOW        Anywhere

OpenSSH (v6)    ALLOW        Anywhere (v6. Suppose you need to install and configure additional services. In that case, you need to configure the firewall settings so that the traffic of other protocols is allowed to enter the server. Currently, the firewall blocks all connections except SSH.r.

11- Activating External access for normal users

Now that you have defined and configured a standard user account for daily use, you need to make sure you can log in directly to the SSH account. Configuring SSH access for a new user depends on whether the server’s root account uses a password or an SSH key for authentication.

12- Root user authentication using password

If you are logged in to the root account using a password, it means that password authentication is enabled for SSH. For this purpose, you need to open a new terminal and use SSH with a new username. You can SSH into the new account using the following command.

ssh sammy@your_server_ip

After entering the password of the standard user account, you can log in to the system. Be careful; if you need to run a command with administrative privileges, type sudo before that command as follows:

sudo command_to_run

You will be prompted for the regular user password when using sudo for the first time in each session (and periodically after that). We suggest using SSH keys instead of password authentication to increase server security.

13- Authentication of root user using SSH key

If you’re logged in using SSH keys, password authentication for SSH is most likely disabled. You need to add a copy of the local public key to the new user’s ~/.ssh/authorized_keys file for successful login. Since the public key already exists in the root user’s ~/.ssh/authorized_keys file on the server, you can copy that file and directory structure to the new user account in the current session.

The easiest way to copy files with the correct permissions is to call the rsync command. This command copies the root user’s .ssh directory preserves permissions for the new user to use, and changes the list of file owners. For this purpose, type the following command (make sure to type your username instead of the word Sammy):

rsync –archive –chown=sammy : Sammy ~/.ssh /home/Sammy

Now open a new session and use SSH with the new username:

ssh sammy@your_server_ip

You can now log in to the new user account without asking for an SSH password. If the SSH key is set with a key phrase, you will first be prompted to provide the SSH key lock. Note that if you need to run a command with administrative privileges, you must use the word sudo before your orders.

sudo command_to_run

After completing the above steps, the Ubuntu 18.04 server is ready to use. Now you can install your desired software on the server.