The login records for the ‘last‘ command are kept in a data file ‘/var/log/wtmp‘. The command ‘last’ parses this data file and gives back the output. There is also a provision for another data file ‘/var/log/btmp‘ to be created to store bad logins, which can be read using the command ‘lastb‘. Using logrotate to rotate […]
Archives for September 2017
Linux OS Service ‘network’
Service Name network Description The ‘network‘ service activates or deactivates all network interfaces configured to start at boot time. The traditional TCP/IP v4 networking is always enabled if networking is used. The newer TCP/IP v6 may be selectively enabled here. The default system hostname is also provided here but may be later changed as individual […]
CentOS / RHEL : How to get the date and time of executed command in the history command output
The default history command output is always sorted by date unless there are any changes made to the configuration. The output is not in date order because session writes their history at different times. History file is written when the session gets over. Follow the steps given below to the date of execution in the […]
CentOS / RHEL : How to Change the login shell of the user
The file /etc/shells the full paths for all the login shells available on the system. So, to set the particular shell, the shell entry must be present in /etc/shells file. # cat /etc/shells /bin/sh /bin/bash /sbin/nologin /bin/dash /bin/tcsh /bin/csh You can also use the chsh -list or chsh -l command to list out the available […]
Linux OS service ‘portmap’
Service Name portmap Description Portmap service maps RPC requests to the correct services. RPC processes notify portmap when they start, revealing the port number they are monitoring and the RPC program numbers they expect to serve. The client system then contacts portmap service on the server with a particular RPC program number. portmap then redirects […]
Linux OS service ‘auditd’
Service Name auditd Description auditd is the userspace component to the Linux Auditing System. It’s responsible for writing audit records to the disk. Viewing the logs is done with the ausearch or aureport utilities. Configuring the audit rules is done with the auditctl utility. During startup, the rules in /etc/audit.rules are read by auditctl. The […]
CentOS / RHEL : How to add iptable rules
The syntax to add an iptables rule is as shown below. # iptables -I INPUT [line number] -s [ip address or subnet] -j ACCEPT For example to add a new rule at line number 2 to allow subnet 192.168.0.0/24. # iptables -I INPUT 2 -s 192.168.0.0/24 -j ACCEPT Saving iptable rules After configuring the iptables […]
Can’t start X11 applications after “su” or “su -” to another user
To get access to the X client applications such as system-config-date, xclock, vncviewer we need to export the DISPLAY settings of a remote host to the local server. This is commonly done using below commands. # ssh root@remotehost remotehost# export DISPLAY=x.x.x.x:y.y Where x.x.x.x:y.y – is the display settings of the system from which you connected […]
CentOS / RHEL : How to add Physical Volume (PV) to a Volume group (VG) in LVM
You may want to add new physical volumes to an existing volume group when logical volumes need to be increased in size or number, but there is no more room on the volume group to accommodate this expansion. The physical volume can either be a partition or an entire disk. For this post we will […]
CentOS / RHEL 6 : How to disable telnet service
For security purposes, administrators may wish to disable telnet (incoming connections) on CentOS / RHEL 6. Follow the steps below to disable telnet permanently on your system. 1. For disabling the telnet server, edit /etc/xinetd.d/telnet and change the field disable to yes. # vi /etc/xinetd.d/telnet service telnet { flags = REUSE socket_type = stream wait […]