The iptables utility controls the network packet filtering code in the Linux kernel. The iptables feature is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. Several different tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains. […]
Archives for May 2017
Basic vi commands (cheat sheet)
vi is one of the most commonly used editor program and included by default with every UNIX and linux system. vi basically operates in 3 modes, namely : vi mode – the mode vi starts in command mode – you can be in command mode from the vi mode by pressing the key colon (“:”) […]
What’s the difference between locate and find command in Linux
Two popular commands for locating files on Linux are find and locate. Depending on the size of your file system and the depth of your search, the find command can sometime take a long time to scan all of the data. For example, if you search your entire filesystem for the files named data.txt: # […]
How to use sudo to allow a non-root user run a particular command
With the help of sudo, you can give access to a non-root user to run a root only command. Here is a short howto to provide the non-root user the access to a root only command. The command access that we will give to a user named “john” will be “/sbin/poweroff”. Giving sudo access to […]
CentOS / RHEL 6 : How to setup yum repository using locally mounted DVD
A yum repository (or “repo” for short) is a collection of RPMs in a single location, for example, on a web site or in a directory on a DVD. In RHEL 6.0 Snapshot 12 there are 5 repositories: 1. HighAvailability 2. LoadBalancer 3. ResilientStorage 4. ScalableFileSystem 5. Server The Server repo is the main repo […]
CentOS / RHEL : Managing password ageing for users using chage (with practical Examples)
For security reasons, it is good practice to require users to change their passwords periodically. To configure password expiration for a user from a shell prompt, use the chage command. The basic syntax of the chage command is : # chage [option] [username] The table below lists out the command line options that can be […]
CentOS / RHEL : How to configure a user account to never expire (disable password ageing)
Question : How to configure a user account so that the password will never expire? Answer: By default passwords do not expire on user accounts. If an expiration date has been added to an account and you wish to remove it use either the passwd or chage commands to change the maximum number of days […]
CentOS / RHEL 5,6 : How to Change the timezone
Timezone configuration on Linux is usually set up at installation time. On RHEL 5 and 6, the procedure to change the Timezone configuration is as follows. The example used here is from timezone MDT to IST. The timezone can be either changed from command line or using the system-config-date command. Using system-config-date command Use the […]
How to find the inode size of an ext2/ext3/ext4 filesystem?
By using the tune2fs tool with the option, -l, the inode size of the filesystem could be seen. Using the same option, other information of the filesystem superblock can also be seen. The superblock contains information about the filesystem, such as the number of free blocks available, and the number of mounts, that may be […]
DHCP configuration file /etc/dhcp/dhcpd.conf explained
The main DHCP configuration file is /etc/dhcp/dhcpd.conf. The file is used to store the network configuration information required by DHCP clients. There is also a sample configuration file at /usr/share/doc/dhcp-[version]/dhcpd.conf.sample. # cat /usr/share/doc/dhcp*/dhcpd.conf.sample # dhcpd.conf # # Sample configuration file for ISC dhcpd # # option definitions common to all supported networks… option domain-name “example.org”; […]