CentOS
Cent Operating System
Articles
How To Auto Mount a FileSystem Using Systemd?
Below example shows how to create a systemd script to mount a disk under a specific path on reboot automatically.
1. Check the filesystem UUID using the command...
How To Install Icinga 2 on CentOS 7 / RHEL 7
CentOS 7 / RHEL 7 are end of life. Icinga 2 is an open-source monitoring system for hosts and services, with a web interface (Icinga Web). Its official packages are...
How systemd-tmpfiles Cleans /tmp and /var/tmp (tmpwatch Replacement)
systemd-tmpfiles creates, cleans and removes temporary files and folders according to simple rule files. It replaced tmpwatch (CentOS 6 and older), and it is what...
How to Add, List, Delete and Change Samba Users (smbpasswd, pdbedit and Failed to add entry for user)
Samba keeps its own passwords, separate from Linux login passwords, and every Samba user must first exist as a Linux user. As root:
sudo useradd -M -s...
How to Allow or Deny Users on a vsftpd FTP Server
vsftpd decides who may log in with three separate mechanisms: a user list that can work as a block list or an allow list, a fixed list of accounts that are always...
How to Back Up and Restore XFS File Systems (xfsdump / xfsrestore)?
Use the xfsdump and xfsrestore utilities to back up and restore files in an XFS file system. You can back up files to directly attached tape drives or hard drives, or...
How to Boot Linux into Rescue, Emergency or Recovery Mode
To boot Linux into rescue mode, stop the GRUB menu, press e, add systemd.unit=rescue.target to the end of the line that starts with linux and press Ctrl+X. For...
How to Boot into Single User Mode on RHEL 8, 9 and 10
On RHEL 8, 9 and 10, single user mode is called rescue mode (the systemd rescue.target). To boot into it, stop the GRUB menu, press e, add systemd.unit=rescue.target...
How to Change the Default Log Directory (/var/log) for rsyslog
Logs normally live in /var/log. If that disk is small, or logs must be kept on a separate disk, there are two ways to move them: point rsyslog's log files to another...
How to Change the Kernel Command Line Permanently (grubby and GRUB)
The kernel command line holds boot options such as crashkernel=, console=, transparent_hugepage= or ipv6.disable=1. This guide changes it permanently, for the current...
How to Change the Permissions of /var/log/messages on RHEL, AlmaLinux and Rocky Linux
On AlmaLinux, Rocky Linux and RHEL, /var/log/messages is readable by root only (-rw-------). If a monitoring tool or an application running as another user must read...
How to Change the Timeout Before Falling Back to the Secondary DNS Server
When the first DNS server in /etc/resolv.conf does not answer, every lookup waits before trying the next one: by default 5 seconds per attempt, with 2 rounds through...
How to Change the UUID of an LVM Volume Group or Physical Volume
Every LVM physical volume (PV) and volume group (VG) has a unique ID (UUID). Two disks with the same UUIDs confuse LVM: this happens when a disk is cloned, a VM image...
How to Check a Disk for Bad Blocks and Errors in Linux
Disk errors show up as I/O errors in the logs, slow file access, or a file system that turns read-only. Modern disks (HDD and SSD) replace bad sectors themselves and...
How to Check and Change the Timezone on AlmaLinux, Rocky Linux, RHEL and Fedora (timedatectl)
To check the server timezone on AlmaLinux, Rocky Linux, RHEL or Fedora, run timedatectl and read the Time zone line. To change it, run sudo timedatectl set-timezone...
How to Check if ALUA Is Enabled on a LUN in Linux (sg_rtpg and multipath)
ALUA (Asymmetric Logical Unit Access) is how many storage arrays tell a server which paths to a LUN are fast and which are slower. A LUN is usually reachable through...
How to Check if a Remote Port Is Open with nc (netcat)
To check whether a port on another server is open, run nc -zv -w 3 203.0.113.10 443 (use the server's address and port). -z only opens and closes the connection, -v...
How to Check, Tune or Disable NUMA on Linux
On servers with more than one CPU socket (and on some single-socket processors), memory is divided into NUMA nodes: each CPU reaches its "own" memory faster than...
How to Configure Device File owner/group with udev rules?
Linux creates a device file under /dev for each hardware device when it is attached.By default these files are owned by root and belong to a system group (for example...
How to Configure Django with Apache and mod_wsgi on Linux
mod_wsgi lets Apache run a Django project directly. This guide assumes the project is in /srv/mysite with a virtual environment in /srv/mysite/venv (see "How to...
How to Configure Huge Pages (HugeTLB) on Linux
Huge pages are memory pages of 2 MiB (or 1 GiB) instead of the normal 4 KiB. Large databases and some Java and virtualisation workloads run faster with them, because...
How to Configure Kernel Fallback with GRUB on Linux
CentOS 6 and its GRUB 0.97 "fallback" setting are long obsolete. Current systems use GRUB 2, where the same safety net works with a one-time boot entry. These steps...
How to Configure Nginx with Lets Encrypt on AlmaLinux, Rocky Linux and Ubuntu
CentOS 7 reached end of life on 30 June 2024, so this guide now uses AlmaLinux 9 / Rocky Linux 9 (the steps also suit other RHEL 9 rebuilds).
Let's Encrypt gives free...
How to Configure Remote rsyslog with TLS and Plain TCP
Logs sent over the network in plain text can be read and altered on the way. rsyslog can encrypt them with TLS. This guide sets up a log server that accepts encrypted...
How to Configure Samba Guest and Home Shares on AlmaLinux, Rocky Linux and RHEL
This guide adds two common kinds of Samba share on AlmaLinux, Rocky Linux and RHEL: a read-only public folder that anyone on your network can open without a password,...