How to Clear the Password History in Linux

In Red Hat Enterprise Linux 7 (RHEL 7) the password history is stored in the file /etc/security/opasswd. You can only edit this file while logged in as the root user. You can either selectively delete old passwords from the file or you can clear everything out of the file with the command:

echo “” > /etc/security/opasswd

Sendmail Hangs When Starting Up or When Using It with PHP

If you notice Sendmail hanging up for many minutes while starting up at boot or while being used such as sending an email from a PHP script, it is probably a DNS lookup problem. Ensure your /etc/hosts file has the appropriate entries for your server that sendmail is running on:

127.0.0.1       localhost localhost.localdomain
192.168.1.80    www.foo.com www
192.168.1.80    www.foo.com.

Replace “www.foo.com” and “www” with your server’s fully qualified domain name and host name respectively. Replace “192.168.1.80” with the IP address of your server. The last entry with the “.” at the end is critical so don’t forget it.

Terminal


VSFTPD Error “500 OOPS: reading non-root config file”

After setting up a new Linux server I kept getting the following error whenever I tried to upload something with the VSFTPD ftp service:

500 OOPS: reading non-root config file

It turns out that I had the following setting in the /etc/vsftpd/vsftpd.conf file:

user_config_dir=/etc/vsftpd/virtual_users

I commented out that setting and restarted the vsftpd service and the problem went away. I then checked to make sure I had spelled the “user_config_dir” directory name correctly and it turns out that I had created the directory with the name “virtual_user” without the “s” at the end. So that error appears to be caused by the “user_config_dir” not being present or accessible to the VSFTPD service. If you get this error make sure the directory you specify for the “user_config_dir” exists and is accessible.

How to Configure CentOS for Graphical X11 or Multiuser Mode on Boot

Sometimes when I install CentOS it does not start up in “graphical mode” – that is it starts up directly at the command prompt rather than automatically starting up X Windows. You can configure CentOS to start up in whatever mode you want including graphical mode by editing the file /etc/inittab. To change the startup mode of CentOS open that file with a text editor.

# nano /etc/inittab

The file should look like the following:

# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
id:3:initdefault:

As you can see, the file gives you the number-to-mode mapping at the top. All you need you do is change the number in the last line listed above. So for me I needed to change the 3 to a 5:

id:5:initdefault:

So my final /etc/inittab file looked like the following:

# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
id:3:initdefault:

Reboot your computer and it should now start up in whatever mode you specified.