Redhat Linux

Docker installation on RHEL 7 Linux

Objective The objective is to install Docker engine on Redhat 7 Linux using native docker script. Requirements Internet connection as well as a privileged access to your Redhat 7 Linux is required. Difficulty EASY Conventions # - requires given command to be executed with root privileges either directly as a root user or by use of sudo command $ - given command to be executed as a regular non-privileged user Instructions Install docker Installation of docker using a native docker script is one...
Read More...

Unbound cache-only DNS server setup on RHEL 7 Linux

Introduction Unbound is a validating, recursive, and caching DNS server. Having said that, Unbound DNS server cannot be used as an authoritative DNS server, which means it cannot be used to host custom domain name records. As a result, if your goal is to build a cache-only or forwarding DNS server, Unbound may be your preferred choice, as it does just that and it does it well. Objective The objective is to provide quick and easy to follow installation and configuration guide for the Unbound...
Read More...

How to disable last login message on RHEL Linux

Objective The objective is to permanently disable a last login message after user terminal or ssh login on Redhat Linux. Example: $ ssh linuxconfig@10.1.1.45 linuxconfig@10.1.1.45's password: Last login: Tue Dec 6 11:23:11 2016 from 10.1.1.3 Requirements Privileged access to your Redhat Linux server. Difficulty EASY Conventions # - requires given command to be executed with root privileges either directly as a root user or by use of sudo command $ - given command to be executed as a regular...
Read More...

RHEL7 - user is not in the sudoers file error

Objective By default the regular user does not have an ability to execute commands with root privileges. As a result the following message will appear: $ sudo -i [sudo] password for linuxconfig: linuxconfig is not in the sudoers file. This incident will be reported. The objective is to gain a superuser ( root ) access on Redhat 7 Linux server using sudo command. Requirements Privileged root access to your Redhat 7 Linux server installation. Difficulty EASY Conventions # - requires given...
Read More...

How to mount CD/DVD ROM on RHEL 7 Linux

Objective The objective is to mount a CD/DVD block device with ISO 9660 disk image/media. Requirements Privileged access to your Redhat 7 system. Difficulty EASY Conventions # - requires given command to be executed with root privileges either directly as a root user or by use of sudo command $ - given command to be executed as a regular non-privileged user Instructions Locate Block device First we need to find a correct CD/DVD block device. To do this execute a command blkid : # blkid...
Read More...

How to reset the root password in RHEL7/CentOS7/Scientific Linux 7- based systems

Objective Resetting the root password in RHEL7/CentOS7/Scientific Linux 7 Requirements RHEL7 / CentOS7 / Scientific Linux 7 Difficulty MODERATE Instructions Things have changed in the RHEL7 world and so has the preferred way of resetting the root password. Although the old way of interrupting the boot process (init=/bin/bash) still works, it is no longer bulletproof and recommended. 'Systemd' uses 'rd.break' to interrupt the boot. Let's have a quick walk through the whole procedure.
Read More...

Creating a Redhat package repository

Introduction If your Redhat server is not connected to the official RHN repositories, you will need to configure your own private repository which you can later use to install packages. The procedure of creating a Redhat repository is quite simple task. In this article we will show you how to create a local file Redhat repository as well as remote HTTP repository. Using Official Redhat DVD as repository After default installation and without registering your server to official RHN repositories...
Read More...

How to establish PPTP VPN client connection on CENTOS/RHEL 7 Linux

This guide will discuss a procedure on how to connect/establish a VPN connection using PPTP protocol on CentOS 7 or Redhat 7 Linux the non-GUI way. Below you can find connection details which will be used as an example. Replace the bellow PPTP VPN information to align with your PPTP VPN server settings: Connection name: linuxconfig ( can be any descriptive name ) VPN connetion type: PPTP PPTP VPN server IP or domain: 123.123.1.1 CHAP Username: admin CHAP User password: 00000000 Configuration...
Read More...

Persistent/Automatic after reboot kernel module loading on CentOS/Redhat Linux

This config will describe a procedure on how to persistently load kernel modules during a boot time on CentOS or Redhat Linux system. In the below commands will use nf_conntrack_pptp as a sample module. Replace the name of this module with a module name you wish to load. First, create a script within /etc/sysconfig/modules/ directory with a file extension modules . Where the name of the script can be any name of your choice. In our case the script will be called nf_conntrack_pptp.modules....
Read More...

How to set the primary display on CentOS/RHEL 7 with dual monitors and GNOME

This article will describe a way on how to change/set a primary display on CentOS/RHEL 7 with dual monitors and GNOME. The easiest and perhaps recommended way is to use GUI and navigate to Applications-> System Tools-> Settings-> Displays . The current primary screen is highlighted by a black top bar. To change you primary display simply drag-n-drop the black top bar from one screen to another: . Another alternative is to you command line tool xrandr . First get all your connected screens: $...
Read More...

How to enable EPEL repository on RHEL 7 without a current Red Hat Subscription

If you currently do not hold a Red Hat Subscription and yet you need to enable EPEL ( Extra Packages for Enterprise Linux ) repository on your RHEL 7 Linux you need to download and install following file directly from Fedora project: epel-release-7-5.noarch.rpm
Read More...

Configure firewall to enable NTP port 123 on RHEL7 Linux

Once you configure NTPD service on your RHEL7 linux you will need to allow traffic through the firewall on port 123. Te following command will enable all public traffic on UDP port 123: # firewall-cmd --zone=public --add-port=123/udp --permanent success
Read More...

Working with systemd targets on RHEL7 Linux beginners cheatsheet

Below you can find a list of most frequently used commands in association with systemd targets: List current active default target # systemctl get-default List all active systemd targets: # systemctl list-units --type target
Read More...

How to list all available locales on RHEL7 Linux

The following command will list all available locales currently available on the Redhat 7 system: [root@rhel7 ~]# localectl list-locales The list of all available locales on your system my be quite long so use grep command to narrow down your search. Bellow command will display for example all German available locales: [root@rhel7 ~]# localectl list-locales | grep ^de de_AT de_AT.iso88591 de_AT.iso885915@euro de_AT.utf8 de_AT@euro de_BE de_BE.iso88591 de_BE.iso885915@euro de_BE.utf8 de_BE@euro...
Read More...

How to change a static hostname on RHEL7 linux with hostnamectl

Instead of changing a hostname on your Redhat 7 server manually by editing /etc/hostname you may preferably use a dedicated command hostnamectl to do this job. By default when no other options are supplied the hostnamectl command will display basic information including static hostname: [root@rhel7 ~]# hostnamectl Static hostname: rhel7 Icon name: computer Chassis: n/a Machine ID: 75387b56d72b44b380810499805ec28a Boot ID: 6ad251d0e12a10e3af1894eae5fe5cb6 Virtualization: oracle Operating...
Read More...

Establishing Cisco VPN client connection on RHEL 7 using vpnc

The easiest way to create a Cisco VPN client connection on Redhat 7 Linux is to use vpnc client which is an opensource alternative to Cisco VPN client. Let's start by VPNC installation on RHEL7. The VPNC package is located within EPEL ( Extra Packages for Enterprise Linux 7 ) repository thus first enable EPEL repository: # subscription-manager repos --enable=rhel-7-server-optional-rpms
Read More...

How to add a new static route on RHEL7 Linux

Previously we have talked about how to configure a default gateway on RHEL7 Linux . This time we will talk about how to add a static route on RHEL7 Linux. Any network we are trying to reach is accessed via default gateway only if it is not implicitly overwritten by another static route definition. Let's have a look at a current routing table on our Redhat 7 Linux box: root@rhel7 ~]# ip route show default via 10.1.1.1 dev enp0s3 proto static metric 1024 10.0.0.0/8 dev enp0s3 proto kernel scope...
Read More...

Recover a forgotten root password on Redhat 7 Linux Selinux system

The way on how you can reset a forgotten root password on a Linux system have not changed for many years. Resetting a root password on RHEL7 Linux system have not change much except that now we deal with SElinux and the system is now using systemd instead of init . Nevertheless, those who have already did reset root password on the Linux system will be with the following steps familiar. Here is the procedure of what needs to be done in order to recover a forgotten root password on Redhat 7...
Read More...

How to stop/start and disable/enable Firewall on Redhat 7 Linux system

The firewall on Redhat 7 Linux system is enabled by default. Normally there should not be a need to disable firewall but it may be quite handy for testing purposes etc. On Redhat 7 Linux system the firewall run as firewalld daemon. Bellow command can be used to check the firewall status: [root@rhel7 ~]# systemctl status firewalld firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled) Active: active (running) since Thu...
Read More...

How to monitor a CPU temperature on Redhat 7 Linux system

Here is a short config to show you how to display and monitor CPU temperature on a Linux system running Redhat 7 Linux. First we need to install lm_sensors : # yum install lm_sensors Next, use sensors command to display CPU temperature: $ sensors | grep Core Core 0: +43.0°C (high = +86.0°C, crit = +100.0°C) Core 1: +43.0°C (high = +86.0°C, crit = +100.0°C)
Read More...