Question: How to disable BASH shell history, so that it does not save users shell history? Solution: Add a line like the following to the end of /etc/profile or a new /etc/profile.d/*.sh file unset HISTFILE This will make each user’s bash shell to skip saving history files unless the users manually configure the HISTFILE variable. […]
Archives for February 2017
CentOS / RHEL : How to add a null route in Linux
As Per the ip man page, there are three route types which will drop traffic in specific ways: Route types: unreachable – these destinations are unreachable. Packets are discarded and the ICMP message host unreachable is generated. The local senders get an EHOSTUNREACH error. blackhole – these destinations are unreachable. Packets are discarded silently. The […]
How to configure Kdump on SuSE Linux Enterprise System 10 and 11
The post describes how to setup kdump on SuSE Linux Enterprise System (SLES) 10 and 11 to capture core dumps from Kernel panics and crashes. Kdump (kernel dump) provides a memory dump into a file named vmcore when the kernel has critical issue. Vmcore is often required to investigate the issue. The crash dump is […]
CentOS / RHEL : How to backup/restore configuration using authconfig
Steps 1. Backup the configuration files using authconfig utility. The general syntax for the command is : # authconfig –savebackup=[name] For example : # authconfig –savebackup=config_backup 2. Backup’s are saved at following location: # ll /var/lib/authconfig/backup-config_backup/ total 80 -rw-r–r– 1 root root 401 Oct 28 00:18 authconfig -rw-r–r– 1 root root 1 Oct 28 00:18 […]
CentOS / RHEL 7 : Never run the iptables service and FirewallD service at the same time!
By default, RHEL 7 uses the FirewallD service to provide network security. FirewallD must be stopped and disabled when using the iptables service: # systemctl stop firewalld.service # systemctl disable firewalld.service # systemctl enable iptables.service # systemctl start iptables.service The iptables service is now provided by a separate package called iptables-services: # yum info iptables-services […]
CentOS / RHEL 7 : Unable to start/enable iptables
Problem: When trying to start/enable the iptables daemon you receive the errors: # systemctl enable iptables Failed to issue method call: Access denied # systemctl start iptables Failed to start iptables.service: Unit iptables.service failed to load: No such file or directory. Solution: Starting with RHEL 7, firewalld is introduced and by default the iptables package […]
UNIX / Linux : Examples of bash history command to repeat last commands
One of the extensively used command in UNIX world is the history command. Every flavor of UNIX has the history command. The bash shell stores a history of commands entered, which can be used to repeat commands by using the history command. By default, it’ll show the previous 1000 commands that were used. Here’s a […]
CentOS / RHEL 6 : How to list or install only security updates with yum
Question: Is it possible to limit yum so that it lists or installs only security updates? How to patch the system only with security errata? Install the yum-security plugin It is now possible to limit yum to install only security updates (as opposed to bug fixes or enhancements) by installing the yum-security plugin. Contrary to […]
watch command examples to run a command repeatedly or monitor dynamically changeable files (like /proc/*)
Watch command is a really neat tool and comes in handy in many situations. The watch command can be used to monitor any file or script periodically. It runs every 2 seconds by default and it will run until interrupted. # watch -h Usage: watch [-dhntv] [–differences[=cumulative]] [–help] [–interval=[n]] [–no-title] [–version] [command] -d, –differences[=cumulative] highlight […]