≡ Menu

How to set password strength requirements on Linux?

The question - I want to set some minimum password length and strength requirements on my Linux CentOS machine. Is there a Linux command or directive to do this? The password authentication module (PAM) called pam_cracklib.so will perform several checks before a password is accepted. Note that on a Linux machine, users can change their [...]

{ 0 comments }

How to set defaut password expiry for all new users?

Linux provides a way to configure options like the default password expiration date for all new users. Every time a new user is added, these defaults will apply to the new user. In Linux, there is a file called /etc/login.defs. This file contains several options that are very useful for a system administrator. The three [...]

{ 0 comments }

logsave – save output of a Linux command to a file

The command logsave can be used to save the output of a command to a log file. This is very useful for the initial boot scripts as while booting, the /var file system is not yet mounted. From the man page: The logsave program will execute cmd_prog with the specified argument(s), and save a copy [...]

{ 0 comments }

How to find out when the Linux box was last rebooted?

The question - I need to find out when my Linux machine was last rebooted. Is there a command that can be used to find this out? There is a command called last which can be used to find this information: [root@server ~]# last reboot reboot system boot 2.6.18-274.7.1.e Fri Sep 13 18:22 - 13:06 [...]

{ 0 comments }

On Linux, there are several commands that can be used to estimate the amount of memory that is used by a process, like top or ps. There is another command that can be used to find how much total memory is used by a process. The command is called pmap. The pmap command outputs the [...]

{ 0 comments }

The question - I want to check when was a file on my Linux box last changed. I want the change date and time. Is there a Linux command to do this? Yes, there is a command called stat which can be used to get several useful statistics on a file. The stat command outputs [...]

{ 0 comments }

How to create a new FTP user in VSFTP?

Question - I want to add a new user for FTP access. I am running VSFTP. How do I do that? Adding a new FTP user is as simple as adding a new user to your Linux box. VSFTP can automatically grant access to FTP to all local users using the same password which is [...]

{ 0 comments }

Linux – Delete files with inode number

The question - I accidentally created a few files with unusual names and I am unable to delete them using the rm command. Is there a way to delete the files in some other way? You can delete the files using the inode number. An inode entry in the inode table contains a unique inode [...]

{ 0 comments }

Check if a Linux bash shell script is run as root

The question - I want my bash shell script to be run only as root. If another user tries to run the script, the script should terminate. Is there a way to do that in a shell script? Bash has several environment variables that indicate which user is running the script: [root@server ~]# echo $USER [...]

{ 0 comments }

How to update to the latest version of CentOS?

The yum command can be used to upgrade the CentOS version to the latest version. Note that yum works with all RPM based distributions like Fedora, Red Hat And CentOS. Simply type the following command on the shell prompt (as root): yum update This will update all packages including the operating system to its latest [...]

{ 0 comments }