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 […]
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 […]
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 […]
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 […]
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 […]
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:
your message here
more of your message
At the […]
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 […]
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 […]
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 […]
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. […]
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.
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 […]
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 […]
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 […]
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 […]
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 […]
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:
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 […]
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 – […]
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 […]
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 […]
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 […]
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 […]
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. […]
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 […]
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 […]
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 […]
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, […]
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 […]
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 […]