How to Check Your Server for Bash Shellshock Vulnerability

The hosting world has been hit with yet another highly publicized server vulnerability. This one affects the ubiquitous shell program GNU Bash and is referred to as Shellshock. Most Linux, BSD and Mac OS X operating systems and variants use Bash or derivatives of it. All Bash versions between versions 1.14 and 4.3 are […]

Understanding Systemd and How to Use It: Part 2

In part one, you learned a little about what systemd is and which Linux distributions plan to use it. In part 2, you will learn how to use systemd to start and stop services. We will use Red Hat Enterprise Linux, CentOS and Fedora in the explanation, but most of it will apply to other […]

Write a Basic Bash Script to Simplify Server Operations

Linux comes with a very powerful tool built into it. It is called the shell. Bash is one version of the shell that is very popular with Linux distributions. If you can learn even basic Bash scripting, you can simplify and automate a lot of tasks you would normally have to manually perform on your […]

Find Out When a Unix/Linux User Last Logged In

Keeping track of your users’ activities may seem a little bit intrusive, but it is very necessary for security-conscious system administrators. When users are logged onto the system, you should know, and if a user account is up to anything suspicious, knowing when the user’s logged in might very well save your system. It may […]

What is a Load Average?

The more traffic your websites and applications generate, the higher the load your server will have to carry. Over the course of a given amount of time, your server may have a variation of high, medium, and low load. The average of that load over time is called the load average.
Programs like “top” allow […]

How to send a system message to all *BSD users

Any good system administrator needs to be able to send authoritative messages to any online users. Fortunately, with BSD variants such as FreeBSD and OpenBSD, it is very easy with a tool called “wall”.
To send a general message to all users logged into the system, follow this format:

# wall
your message here
more of your message

At the […]

How to Run More Than One Bash Command at Once

One of the things that makes Linux servers so powerful is Bash and shell systems similar to it. You can use it to run complex scripts, execute multiple commands, and automate processes. If you ever want to execute multiple commands with bash, there are a couple of easy ways to make it happen.
One method is […]

How to Manually Install Packages on a RHEL/CentOS Server

On Red Hat Enterprise Linux and Red Hat-based servers (ex: CentOS), the best way to install packages is to use YUM. By entering the yum command, you can download and install software from the distribution and third-party repositories without any difficulty. On occasion, however, you might need to install an rpm package that is not […]

How to Disable or Completely Delete Linux Server Users

Disabling a user account can be very useful if the account has been compromised, the user has left but may return in the future, or for punitive purposes. To disable a user on a Linux system, you can use the following command string:
# usermod –lock –expiredate 1970-01-01 <username>
Replace <username> with the actual user’s […]

Quick Bash Command Tricks Part 2

In the first part of this guide, we looked at some bash tricks that help you find things in the command history. In this section of the BASH (Born Again Shell) guide, we will look at some other functions.
Suffix command history
In the last post, we explained how to append the prefix from the previous command. […]

Quick Bash Command Tricks

Bash is the common shell environment used on Linux servers. If you manage a server, there is a good chance you will need to drop to the command line at some point and encounter Bash or one of its alternatives. The following are some basic commands that can help speed up your bash experience.
Reload […]

How to Kill a Zombie Process

Zombies present a particularly unique problem to system administrators. No, I do not mean the type of zombies that eat brains. I mean zombie processes. A zombie process is a process that is no longer active on a system but that refuses to die. In most cases, a zombie is not something that should alarm […]

How to Reset Your Server Settings

When your server suddenly stops functioning the way it is supposed to, there are a number of troubleshooting techniques you can try. One of the most important things you can do is backtrack and investigate to see if some changes you recently made might have caused the server to stop working. If you discover irreparable […]

How to Extract Specific Files from a Tarball

One of the most common methods of archiving files on a Linux or Unix server is called tar. Tar can store any number of files in individual archives and can be used in conjunction with compression programs like gzip and bzip2. Normally, when you want to extract files from a tarball, you simply run the […]

View Real-Time MySQL Loads with Innotop

MySQL is one of the most widely used database management systems. It is free and open source and works very well with dedicated servers designed to power websites. On Linux servers, a program called “top” allows you to see real-time load averages and usage for all running programs. If, however, you just want to see […]

How to String Multiple Linux Commands Together

On a Linux dedicated server, the shell provides a powerful arsenal of commands for you to manage your system. Used in isolation, these commands can be very effective. Used in combination, you can truly unlock the power of your system.
There are a few ways to string commands together. One of the most basic tools you […]

How to Simply Display Directory Disk Usage?

On a Unix or Linux server, the “du” command provides a quick and easy method for finding out how much space each directory is using, as well as a summary of total disk usage. For example, if you just typed “du” from the command line, the output might look like this:
624 […]

Linux Server Security Guide: Part 2

System Logs
Every Linux operating system keeps logs for system processes and applications. You can use those logs to monitor server performance and also sniff out any abnormalities that may be security security related.
There are some common Linux logs that are more important than others, such as the kernel log, authentication log, web server […]

How to Run Commands as Another User

In a previous post, we explained how to use “su” to execute a command as another user, but that is only one of the many ways you can accomplish this on a Linux or Unix server. The following techniques each have their own advantages and can help you run programs under different user identifications.

runuser – […]

How to Schedule Commands in Webmin

Occasionally, you may need to execute a command on your server at an odd time. It can be a nuisance to have to wake up at 4 in the morning to run a software update or some other mundane task. You could setup a cron job, but that is usually for recurring tasks and […]

How to Get Colored Man Pages in Linux

A man page is one of the most valuable tools available on a Linux dedicated server. Although the name might seem to imply something masculine, the word “man” is actually short for “manual”, and on a Linux server, you have probably not come close to unlocking its full potential until you have read some of […]

How to Reinstall a Package with YUM

In the event that something happens to the software you have installed on your server, you may need to reinstall it. YUM, the package manager for Red Hat Enterprise Linux, Fedora, and CentOS, allows you to reinstall packages whenever necessary.
To reinstall a package with YUM, do the following:
# yum reinstall name-of-package
YUM will prompt you before […]

Apache Tip #2: Use Configtest to Try Configurations Before Using

The Apache configuration file is deceptively simple. It is just a plain text file filled with mostly plain words. It does not require a registry, hex editing, or any other form of complex configuration. Still, with one misstep, one typo, or one incorrectly placed directive, you can bring your web server to its knees.
Rather than […]

How to Send Live Messages to All Shell Users

In a previous post, we explained how to send a message of the day (MOTD) to all users whenever they log into your server’s shell. It is a perfect way to reach users when they log in, but it will not allow you to send new messages to users who are currently logged in. […]

Find Out Your Server Load, Users, and Uptime with One Letter

Sometimes, you are in a rush and just need to make sure your server is OK.  There are plenty of commands or scripts you could run to check on your server, but there is only one that only takes a single letter. The “w” command is quick, simple, and can be powerful.
When you are in […]

What to Do When You Forget Your Password

One of the worst feelings you can experience after putting so much time and effort into your dedicated server is to suddenly realize you are unable to control it. Aside from security breaches, the most common reason for this is that you forgot your password. Forgetting a user password is unfortunate, but not the end […]

Monitoring Tips Using the ps Command

The ps command is an extremely powerful tool for monitoring processes on a Linux or Unix server.  Processes are the individual instances of a program running on your server.  With ps, you can find out which programs have running processes, how much memory they are using, how much processor power they are consuming, and which […]

For Backups Rsync Beats FTP

When you decide to backup your server (hopefully sooner than later), you will need to choose a transfer method.  Unless your backup device is physically attached to your server, that transfer method will involve a network or remote Internet connection.  FTP is a common method of file transfer that many people use for their websites, […]

5 Different Ways to List Files on a Linux Server

On your desktop or laptop computer, viewing files is usually as simple as clicking an icon.  Most file managers also have sorting features so that you can view your files in columns, grouped by type, and numerous other variants.
On a Unix or Linux dedicated server, you do not have this luxury.  While you can install […]

How to Create Batches of New Users

When you deploy a new dedicated server, you sometimes need to migrate your users from an old system.  While it is perfectly reasonable to manually add Linux users when there are only a few, adding a large number can be exhausting and time consuming.  Fortunately, the “newusers” command gives you the ability to add multiple […]