What can I do with a Linux server?

Linux is the most commonly used operating system for web-facing computers, running on nearly 75% of servers according to Netcraft’s August 2019 data — we’ll cover how to make your Linux servers more secure

Linux powers the internet as we know it — it took over the digital world early on and hasn’t let up since then. This is why Linux server security is crucial to data security.

Whether you rely on your trusty Android smartphone or enjoy browsing social media platforms like Facebook or Pinterest, Linux likely plays an important role in your daily life — even if you’re not fully aware of it. This reality is even more evident in the business world, where Linux is responsible for the web presence of companies of all sizes. In fact, Netcraft’s June 2020 survey shows that Linux also powers nine of the top 10 most reliable host companies’ websites.

Unfortunately, security concerns are nearly as common as Linux itself. These servers have been under assault for years, but many users remain unaware of the extent to which their data can be compromised without proactive server security measures.

But what can you do to protect your server and increase your Linux server security? We’ll explore the role of Linux hardening and cover 10 best practices you can put into action right away.

Let’s hash it out.


12) Install Office Applications

If you are a Microsoft Windows user and want to switch to the Linux then you may think about Word Processing software. LibreOffice and OpenOffice are very good alternatives to the Microsoft Office application. LibreOffice allows you to easily read and write Microsoft Office Word, Excel, and PowerPoint files. LibreOffice allows you to change the default format for saving documents from ODF to the Microsoft Office formats so you can easily exchange documents with Microsoft Office users.

There are many PDF manipulation tools available in the Linux such as, Master PDF Editor, Okular, Scribus and PDF Escape that allows you to create, edit, and split multi-page PDF documents.

How to host multiple websites on Linux with Apache

Do you want to host a website for company information plus an e-commerce site? Do you need to host both a public website and an internal one for your organization? You can make either scenario happen within the same hardware via Linux and Apache.

This resource explains the process of hosting multiple websites on a single server using the Apache web browser. Apache is free and open source web server software enabling you to deploy websites to the internet. And it’s the most commonly used web server on the Linux operating system.

TechRepublic Premium

How to deploy an LDAP server

Lightweight Directory Access Protocol (LDAP) allows for the querying of a directory service over a network, making it useful for things like authentication. Using an LDAP server, users can log into their accounts from any machine on your internal network. But LDAP can do more than just authenticate desktops. You can also use it to validate usernames and passwords via Docker, Jenkins, Kubernetes, OpenVPN and Samba.

This guide will walk you through installing OpenLDAP on Ubuntu Server 20.04, setting up a management GUI and getting computers to authenticate to the server.

TechRepublic Premium

3) Add Extra Repositories

By default, Linux ships with built-in repositories that can be used to install various software in your system. In some cases, your required software is not included in the built-in repository. Then, you will need to add additional partner repositories for installing extra drivers and software.

Some of the repositories are disabled in some Linux versions then you will need to enable them from the Software & Updates.

You can find them in the following screen:

5. Installed software

Testing software always requires installing additional dependent packages, libraries, etc. However, before I install anything, I check what is already installed (including what version it is), as well as which repos are configured, so I know where the software comes from, and I can debug any package installation issues.

Use the following commands to identify what software is installed:

9. Logs

By now, I have a good idea about the server, including what software is installed and what processes are running. One other thing I cannot escape is log files—I need to know where to check the information that is continuously being updated.

Use the following commands to see your system’s logs:

Importance of Security on a Linux VPS

As a matter of fact, most prefer a Linux web server over a Windows one for its improved security, however, it is only as secure as the configuration you put on it. When setting up any web server, keep its security in mind. Many will opt for various layers such as WAF (i.e., Web Application Firewalls), IDS (i.e., Intrusion Detection System), or Mod Security to react in real-time to different threats.

Without proper security measures installed on your Linux VPS, malware could find its way onto the server and that is when the trouble starts. If you are storing any sensitive information on said VPS, it can all be stolen because of simple security oversight. Your server can also be used as a spam-sending relay and possibly be blacklisted from certain DNS providers, making your website invisible to anyone using the aforementioned providers.

If your Linux VPS security is lacking, hackers can take control of your server and perform either malicious or outright illegal activities on it. Depending on what they do, you as the owner of the server might even be held responsible for it. In the worst-case scenario, you might completely lose access to the server, however, in most such situations, your web hosting provider will simply delete the compromised VPS and provide you with a new one.

All these threats are simply scratching the surface of what can happen if someone hacks into your server or certain malware is installed on it. Do not forget, however, that these are just that – threats. If proper security measures are taken, they will only stay as threats and will never turn into an actual problem. Here are some measures you can take to help keep the threats away.


Guide Objective

This guides purpose is to teach you how to secure a Linux server.

There are a lot of things you can do to secure a Linux server and this guide will attempt to cover as many of them as possible. More topics/material will be added as I learn, or as folks contribute.

(Table of Contents)

Why Secure Your Server

I assume you’re using this guide because you, hopefully, already understand why good security is important. That is a heavy topic onto itself and breaking it down is out-of-scope for this guide. If you don’t know the answer to that question, I advise you research it first.

At a high level, the second a device, like a server, is in the public domain — i.e visible to the outside world — it becomes a target for bad-actors. An unsecured device is a playground for bad-actors who want access to your data, or to use your server as another node for their large-scale DDOS attacks.

What’s worse is, without good security, you may never know if your server has been compromised. A bad-actor may have gained unauthorized access to your server and copied your data without changing anything so you’d never know. Or your server may have been part of a DDOS attack and you wouldn’t know. Look at many of the large scale data breaches in the news — the companies often did not discover the data leak or intrusion until long after the bad-actors were gone.

Contrary to popular belief, bad-actors don’t always want to change something or lock you out of your data for money. Sometimes they just want the data on your server for their data warehouses (there is big money in big data) or to covertly use your server for their nefarious purposes.

(Table of Contents)

Executing Commands

Commands can be issued at the command prompt by specifying the name of an executable file, which can be a binary program or a script. There are many standard Linux commands and utilities that are installed with the OS, that allow you navigate the file system, install and software packages, and configure the system and applications.

An instance of a running command is known as a process. When a command is executed in the foreground, which is the default way that commands are executed, the user must wait for the process to finish before being returned to the command prompt, at which point they can continue issuing more commands.

It is important to note that almost everything in Linux is case-sensitive, including file and directory names, commands, arguments, and options. If something is not working as expected, double-check the spelling and case of your commands!

We will run through a few examples that will cover the basics of executing commands.

Note: If you’re not already connected to a Linux server, now is a good time to log in. If you have a Linux server but are having trouble connecting, follow this link: How to Connect to Your Droplet with SSH.

Without Arguments or Options

To execute a command without any arguments or options, simply type in the name of the command and hit RETURN.

If you run a command like this, it will exhibit its default behavior, which varies from command to command. For example, if you run the cd command without any arguments, you will be returned to your current user’s home directory. The ls command will print a listing of the current directory’s files and directories. The ip command without any arguments will print a message that shows you how to use the ip command.

Try running the ls command with no arguments to list the files and directories in your current directory (there may be none):

With Arguments

Many commands accept arguments, or parameters, which can affect the behavior of a command. For example, the most common way to use the cd command is to pass it a single argument that specifies which directory to change to. For example, to change to the /usr/bin directory, where many standard commands are installed, you would issue this command:

The cd component is the command, and the first argument /usr/bin follows the command. Note how your command prompt’s current path has updated.

If you would like, try running the ls command to see the files that are in your new current directory.

With Options

Most commands accept options, also known as flags or switches, that modify the behavior of the command. As they are special arguments, options follow a command, and are indicated by a single - character followed by one or more options, which are represented by individual upper- or lower-case letters. Additionally, some options start with --, followed by a single, multi-character (usually a descriptive word) option.

For a basic example of how options work, let’s look at the ls command. Here are a couple of common options that come in handy when using ls:

  • -l: print a “long listing”, which includes extra details such as permissions, ownership, file sizes, and timestamps
  • -a: list all of a directory’s files, including hidden ones (that start with .)

To use the -l flag with ls, use this command:

Note that the listing includes the same files as before, but with additional information about each file.

As mentioned earlier, options can often be grouped together. If you want to use the -l and -a option together, you could run ls -l -a, or just combine them like in this command:

Note that the listing includes the hidden . and .. directories in the listing, because of the -a option.

With Options and Arguments

Options and arguments can almost always be combined, when running commands.

For example, you could check the contents of /home, regardless of your current directory, by running this ls command:

ls is the command, -la are the options, and /home is the argument that indicates which file or directory to list. This should print a detailed listing of the /home directory, which should contain the home directories of all of the normal users on the server.

How to Make a File Executable in Linux terminal?

New to Linux command line and wondering how to make a bash script or some other file executable? Here’s how to do it.…

Team LHB • 17 Feb 2022

The Shell

In a Linux system, the shell is a command-line interface that interprets a user’s commands and script files, and tells the server’s operating system what to do with them. There are several shells that are widely used, such as Bourne shell (sh) and C shell (csh). Each shell has its own feature set and intricacies, regarding how commands are interpreted, but they all feature input and output redirection, variables, and condition-testing, among other things.

This tutorial was written using the Bourne-Again shell, usually referred to as bash, which is the default shell for most Linux distributions, including Ubuntu, CentOS, and RedHat.


Today we have discussed what is a Linux VPS, the importance4 of having a good security configuration on it. We also presented you with 8 easy steps you can take right now to improve your Linux servers’ security. We hope this article has been helpful to you, and if you have any questions or if there are some other ways to protect your Linux server, mention it in the comments below.

Also if you have a Windows VPS server you can check this article about windows server security.

People are also reading:

Linux Tags:



Leave a Reply

Your email address will not be published.

Go up