Posts for: #Linux

Time and Date Concepts and Configuration

relevant terminology

NTP internet server 

Public time servers that can be used as time sources by anyone.

NTP server 

== the server that provides time to the enterprise NTP clients  usually connects to an internet time server 

NTP peer 

An NTP node that receives time from an NTP server  When it loses its connection to the NTP server, it requests time from the other available NTP peer(s). 

[Read]

Linux Bash Scripting

using variables within bash scripts

I created a simple bash script, added the execute bit and moved it to /usr/bin to make is accessible by all Linux users:

user01@rhel10-vm4:~$ vim simplescript02
user01@rhel10-vm4:~$ ls -l simplescript02 
-rw-r--r--. 1 user01 user01 48 Oct 30 00:48 simplescript02
user01@rhel10-vm4:~$ chmod +x simplescript02 
user01@rhel10-vm4:~$ mv simplescript02 /usr/bin/
mv: cannot move 'simplescript02' to '/usr/bin/simplescript02': Permission denied
user01@rhel10-vm4:~$ sudo mv simplescript02 /usr/bin/

Displaying the content of the script with numbers of lines:

[Read]

Firewalls

firewall integration in Cisco ACI

(do a blog search for “service_insertion”)

firewalls in Linux

The default host-based firewall in RHEL allows all outgoing connections and blocks all incoming ones, except those explicitely permitted.

The firewall daemon is called firewalld. To interact with it, use the firewall-cmd tool. The firewalld daemon translates the instructions of firewall-cmd into nftables policies that are understood by the kernel.

firewall rules

An inbound connection that is permitted is a connection that matches a firewall rule. A firewall rule is all about a firewalld service. A firewalld service is added with firewall-cmd --add-service or removed with firewall-cmd --remove-service.

[Read]

Domain Name Resolution

name resolution in Linux

Name resolution in Linux is a pipeline of verification jobs, not a single file: a process consults the Name Service Switch, which has a configuration file at /etc/nsswitchconf. This file contains a list of entries. Each entry describes a database and the list of sources to refer to in the order of their appearance in the entry.

An entry is written in this format: DatabaseName NameService1 [Status=Action] NameService2

[Read]

SELinux

SELinux is an implementation of the Mandatory Access Control security model in the Linux kernel. It bears more weight than the Discretionary Access Control security model, implemented as the Unix-based file permissions (ugo, rwx); To illustrate the power of SELinux, a Linux user, even the root account, gets denied access to his own files if the result of the SELinux authorization chain is a deny.

SELinux assigns a context (aka label) to every Linux user, process, file, directory, port, socket, hardware device, etc. These are considered as either subjects (Linux users and processes) or objects (files, directories, ports, …).

[Read]

Deploying RHCSA home labs

RHEL VMs guests on a Rocky Linux host with kvm

#TBC

RHEL VM guests on a Windows host with VirtualBox

Target is to build two RHEL VMs on in Virtualbox on a Windows machine.

Virtualbox must always be executed as administrator.

The installation of the extension pack might fail many times. What worked for me is patience and repetition, until I saw the green tick in the menu.

Shared clipboard and shared folder features will not work even if you activate them from the Virtualbox menu. What helped is to mount the VboxGuestAdditions.iso file from the GUI, check it in the shell terminal with lsblk, register the VM to Red Hat CDN with sudo subscription-manager register and provide my registration account details, reboot the machine, issue a dnf repolist to refresh the DNF repos, install the kernel headers with dnf install kernel-devel-$(uname -r) and reboot the VM again.

[Read]

mounting and unmounting network filesystems in Linux

definitions

NFS is one of the network filesystems available on Linux. An NFS server has the NFS service installed and enabled. It hosts the mounted filesystem that shall be made available to remote systems. This action is called export and involves these files:

  • /etc/exports: where I configure the mounted filesystems that need to be remotely available to the defined machines,
  • /var/lib/nfs/etab: is called the master export table. It is populated as soon as an entry, in a correct format, is recorded in the /etc/exports file and exportnfs -a is run. The exportnfs -a command reads the entries of /etc/exports to do its job. I am simplifying these steps with the expression create an NFS share.

establish a NFS export

Here is my lab topology: rhel10-vm1 (192.168.122.216): NFS server <—> rhel10-vm2 (192.168.122.6): NFS client.

[Read]

local filesysytems and swap in Linux

filesystem concepts

A filesystem (aka filesystem) is the software structure (the formatting) that is located on a storage device or in memory, and dictates how data is organized there.

When a filesystem is located on a storage device, like a disk or DVDROM, then it is called a physical filesystem. When it is located in memory, like for example when the Linux kernel loads the proc filesystem in RAM, then it is called a virtual filesystem.

[Read]

Linux Storage Concepts

units of measurement in storage

When referring to storage capacities, there are two units of measurements:

  • the multiples of 1024, where capacities are written using the IEC notation:
    • 1 kiB = 1 K, one kibibyte
    • 1 MiB = 1 M, one mebibyte
    • 1 GiB = 1 G, one gibibyte
    • 1 TiB = 1 T, one tebibyte
    • etc.
  • the multiples of 1000, which is also used in IT networking for communication speed, throughput or bandwidth. In this case, capacity values are written using this notation:
  • 1 kB: one kilobyte
  • 1 MB: one megabyte
  • 1 GB: one gigabyte
  • 1 TB: one terabyte
  • etc.

Commands that use units of 1024 bytes: fdisk, lsblk, sfdisk, etc.

[Read]

Linux Tuning Profiles

Preprovisioned tuning profiles

user1@rhel10-vm2:~$ ls /usr/lib/tuned/profiles
accelerator-performance  balanced          desktop      intel-sst            network-latency     optimize-serial-console  throughput-performance  virtual-host
aws                      balanced-battery  hpc-compute  latency-performance  network-throughput  powersave                virtual-guest
user1@rhel10-vm2:~$

Verify and change tuning profiles

Verify that the tuned service is installed with DNF:

user1@rhel10-vm2:~$ dnf list --installed | grep tuned
tuned.noarch                                   2.25.1-2.el10_0                @rhel-10-for-x86_64-baseos-rpms   

Verify the status of the service with systemctl:

user1@rhel10-vm2:~$ systemctl status tuned
● tuned.service - Dynamic System Tuning Daemon
     Loaded: loaded (/usr/lib/systemd/system/tuned.service; enabled; preset: enabled)
     Active: active (running) since Fri 2026-08-21 19:29:51 CEST; 1h 15min ago
 Invocation: fa8cec68b5b449ee9d4f13e2ef0a4618
       Docs: man:tuned(8)
             man:tuned.conf(5)
             man:tuned-adm(8)
   Main PID: 936 (tuned)
      Tasks: 4 (limit: 10680)
     Memory: 17.7M (peak: 19.7M)
        CPU: 952ms
     CGroup: /system.slice/tuned.service
             └─936 /usr/bin/python3 -Es /usr/sbin/tuned -l -P

Warning: some journal files were not opened due to insufficient permissions.
user1@rhel10-vm2:~$

Display the list of available tuning profiles:

[Read]