Get the disk health status with SMART monitor tools on Debian and Ubuntu Linux

Disk SMART status

Every current disk includes a built-in monitoring feature known as SMART that keeps track of faults. On Linux, there is a software package called smartmontools that may be used to query the SMART status of the disk to see if it will fail soon. Installation apt-get install smartmontools Usage First we need to know the ... Read more

[SOLVED] The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key

Here is the solution if you've got the following error message when updating package lists on Debian (apt-get update): The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key The sury.org Debian package repository has changed its package signing key. To fix the error, just download the new key: wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg Finally, ... Read more

How to prevent that a user deletes a file owned by root in his home directory

Even though a file is held by root and has 700 rights, if the root user saves it in another user's home directory or any other directory owned by another user, that user can remove the file. Example: root@workstation:/home/otheruser# ls -la total 8 drwxr-xr-x 2 otheruser otheruser 4096 Jul 28 11:52 . drwxr-xr-x 3 root      ... Read more

How to prevent a Linux system user from logging into the system

The shell setting in /etc/passwd determines whether a Linux system user may log in via the shell or over SSH. If you don't want a certain user to be able to log in, set the shell to /bin/false or /sbin/nologin. For the user "otheruser" on Debian and Ubuntu Linux, here's an example: usermod -s /bin/false ... Read more

Get a list of all virtual hosts which are defined in all apache configuration files

Have you ever looked in the apache config files to see where a website's virtual host is defined? The apache2ctl script has a useful option that could come in good here. When you execute the command, it should look like this: apache2ctl -S You'll obtain a list of all virtual hosts and default servers in ... Read more

Linux Basics: The gunzip command explained (with examples)

Linux Gunzip Examples

The gunzip command is a widely used command for uncompressing files which are made using the gzip utility. It decompresses files with the.gz or .tgz file extension. The command removes the compressed file. After decompression, the files retain their original extension. Gzip is a popular file compression algorithm that keeps the file’s original mode, ownership, ... Read more

10 Apt Command Examples You Must Know

apt command examples

The apt is the most powerful command-line utility for managing the packages such as installing packages, updating package info, upgrading packages as well as Linux kernel, and removing unused packages in the Linux Debian family. The apt command is a CLI package managing tool that is a combination of apt-get and apt-cache which is more ... Read more