How to create a simple encrypted Two-Way SSH tunnel

How to create a simple encrypted Two-Way SSH tunnel

Why would you need to create a simple Two-Way SSH tunnel? In your Linux system administration job have you ever found your self in a situation in which you cannot SSH to a any of your servers/hosts that may be behind a firewall, NAT or otherwise obstructed from an easy access.

In order to gain the access, you would need to reconfigure the firewall or create VPN which could be an enormous overhead just because you need to execute few commands from now and then. With Two-Way SSH tunnel you can connect to any destination under a single condition, which is, the ability to ssh login from the destination to the source.

If you can do that, you can as well reverse login from source to destination even if it is behind firewall or NAT.

In this tutorial you will learn:

  • How to create Two-Way SSH tunnel

Read more

NRPE - Nagios Remote Plugin Executor

How to setup NRPE for client side monitoring

Nrpe, or Nagios Remote Plugin Executor, is the client side service of a monitoring setup. The monitoring server will send commands to the client, which listens passively when got no work to do. Upon incoming command, the nrpe checks it’s local configuration, and executes the plugin configured with the command, then sends back the results to the server for processing. You can read more about the server side installation in the Nagios installation guide, while this guide will focus on the client side.

In this tutorial you will learn:

  • How to install NRPE on Debian/Red Hat based distributions
  • How to configure NRPE to accept commands from the server
  • How to configure a custom check on the server and client side

Read more

Bash Terminal

How to Debug Bash Scripts

There are techniques from traditional programming environments that can help.
Some basic tools like using an editor with syntax highlighting will help as well.
There are builtin options that Bash provides to make debugging and your everyday Linux System Administration job easier.

In this article you will learn some useful methods of debugging Bash scripts:

  • How to use traditonal techniques
  • How to use the xtrace option
  • How to use other Bash options
  • How to use trap

Read more

epel-banner

How To enable the EPEL Repository on RHEL 8 / CentOS 8 Linux

Although it’s been a while since the release of Red Hat Enterprise Linux 8, the corresponding version of the EPEL repository (Extra Packages for Enterprise Linux) was only released few days ago. The repository contains packages that are not provided by the official software sources, as for example extundelete, an utility to recover deleted files from ext3/4 filesystems. Until now the solution to install those software was to build it from source or to use the previous version of EPEL (less than ideal). In this tutorial we will see how to add EPEL8 to RHEL 8 / CentOS 8.

In this tutorial you will learn:

  • How to add the EPEL8 repository to RHEL 8 / CentOS 8
  • How to check all the packages contained in the EPEL8 repository

Read more

Install Puppet on RHEL 8 / CentOS 8

How to Install Puppet on RHEL 8 / CentOS 8

IT admins rely on Puppet to manage complex deployments every day. If your network is built on Red Hat systems, you’re going to need to install Puppet on RHEL 8 / CentOS 8. Puppet Labs provides a repository and packages, so the whole thing should be relatively hassle free.

In this tutorial you will learn:

  • How to Enable the Puppet Repo
  • How to Install Puppet for Servers/Puppet Masters
  • How to Update Servers/Puppet Masters
  • How to Install Puppet for Clients
  • How to Update Puppet Clients

Read more

User is not in the sudoers file error message on RHEL 8 / CentOS 8 Linux

RHEL 8 / CentOS 8 add user to sudoers

The sudo command allows regular users to execute commands with administrative/root privileges. By adding any user to predefined sudo group wheel will grant root privileges to execute any command as root user. Any attempt to use the sudo command for the non-sudo user will result in:

user is not in the sudoers file.  This incident will be reported.

In this tutorial you will learn:

  • How to create sudo user on RHEL 8 / CentOS 8 system.
  • How to add existing user to sudoers.

Read more

Opening and Closing firewall ports on RHEL 8 / CentOS 8 using firewall-cmd command.

How to open and close ports on RHEL 8 / CentOS 8 Linux

Firewalld is a powerful and yet simple to use tool to manage a firewall on RHEL 8 / CentOS 8 Server or GNOME workstation. Firewalld allows to manage open or close ports using predefined services as well as open and close user custom ports.

In this tutorial you will learn:

  • How to open and close ports on RHEL 8 / CentOS 8 with Firewalld.
  • How to open and close services on RHEL 8 / CentOS 8.
  • How to reload firewall configuration.
  • How to list open ports or services.

Read more

RHEL 8 - HTTP & HTTPS protocol services. Open ports 80 & 443

RHEL 8 / CentOS 8 open HTTP port 80 and HTTPS port 443 with firewalld

This article explains how to open HTTP port 80 and HTTPS port 443 on RHEL 8 / CentOS 8 system with the firewalld firewall. HTTP and HTTPS protocols are primarily used by web services such as, but not limited to, Apache or Nginx web serves.

For more information about the firewalld firewall visit our introduction guide to firewalld syntax and usage guide.

In this tutorial you will learn:

  • How to open HTTP port 80 and HTTPS port 443.
  • How to open HTTP port 80 and HTTPS port 443 permanently.
  • How to list currently open ports/services.
  • How to close/remove HTTP port 80 and HTTPS port 443.

Read more

Linux Home Directory With Symlinks

How to Save Space with Symlinks and Mount Points

When you’re stuck with limited storage space, there’s always the option of purchasing more storage, but what if you can’t. Devices like Chromebooks and some laptops are fairly limited. Thankfully, Linux has a few tricks to help to make your Linux system administration job easier. Because Unix-like systems treat everything as a file, you can easily use symbolic links and mounted partitions to maximize space.

In this tutorial you will learn:

  • How to Use Symbolic Links at /home
  • How to Use Symlinks Elsewhere
  • How to Extend Your Storage with Mount Points
  • How to Make Effective Use of Networked Drives

Read more

RHEL 8 / CentOS 8 - FTP protocol service. Open port 21

RHEL 8 / CentOS 8 open FTP port 21 with firewalld

This article explains how to open FTP port 21 on RHEL 8 / CentOS 8 Linux system with the firewalld firewall. The FTP protocol is primarily used by file transfer services such as, but not limited to, vsftpd FTP server. For more information visit our introduction guide to firewalld syntax and usage guide.

In this tutorial you will learn:

  • How to open FTP port 21.
  • How to open FTP port 21 permanently.
  • How to list currently open ports/services.
  • How to close/remove open FTP port 21.

Read more

Check hostname on RHEL 8 Linux system using hostnamectl command

RHEL 8 / CentOS 8 change hostname

A hostname is the label or name linked to a device on a network. Its main purpose is to recognize a device on a specific network or over the internet. There are three different hostname types:

  • Static – Most of the time you will be interested in this type of hostname which is defined by user and the /etc/hostname configuration file.
  • Transient – This type of hostname is defined within kernel space and by default it is set to be the same as the static hostname. Transient hostnames can be set/updated by DHCP or mDNS at runtime.
  • Pretty – Pretty hostname allows for additional characters as per UTF8 character set hence serving rather only for presentation purposes. The pretty hostname also allows to include spaces.

This article will explain how to change or set hostname on RHEL 8 / CentOS 8 Linux server or workstation. To change hostname you will use the hostnamectl command.

In this tutorial you will learn:

  • How to change the static hostname.
  • How to change the transient hostname.
  • How to change the pretty hostname.
  • How to check the current hostname.

Read more

Stopping firewall on Red Hat Enterprise Linux 8.

How to stop/start firewall on RHEL 8 / CentOS 8

The firewall on RHEL 8 / CentOS 8 Linux system is enabled by default allowing for only few services to receive incoming traffic. FirewallD is the default daemon responsible for firewall security feature onRHEL 8 / CentOS 8 Server.

NOTE
The nftables framework replaces iptables as a default network packet filtering feature on RHEL 8.

The following is a list of default firewall opened ports and configured settings on RHEL 8 / CentOS 8 Linux system using the firewalld dynamic firewall daemon:

# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s3
  sources: 
  services: cockpit dhcpv6-client ssh
  ports: 
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

In this tutorial you will learn:

  • How to check the firewall status onRHEL 8 / CentOS 8.
  • How to stop firewall on RHEL 8 / CentOS 8.
  • How to start firewall on RHEL 8 / CentOS 8.
  • How to permanently disable firewall on RHEL 8 / CentOS 8.
  • How to enable firewall to start after reboot.

Read more