Friday, November 21, 2025

Rocky Linux - Basic Operational Procedures

Rocky Linux is an open-source, community-driven Linux distribution designed to be a bug-for-bug compatible downstream rebuild of Red Hat Enterprise Linux (RHEL). It aims to provide a stable, predictable, and enterprise-grade operating system, especially for servers and production workloads.

In this blog post we will document basic Rocky Linux operational procedures.

OS Update Procedure 

# Check current version
cat /etc/os-release 
cat /etc/rocky-release

# Refresh repository metadata (optional but recommended)
dnf clean all
dnf makecache

# Check available updates
dnf check-update

# Apply all updates
dnf update -y
# In Rocky Linux, dnf update = dnf upgrade (they behave the same).
# dnf upgrade -y

# Is Reboot required?
# it is part of yum-utils (yum install yum-utils)
needs-restarting -r

# Reboot if needed
reboot

Procedure to add user

# Add user
useradd username

# Change password
passwd username
 
# Add user to group wheel. Users in group wheel can use sudo 
usermod -aG wheel username

Procedure to change hostname

# Check current hostname
hostnamectl status

# Change hostname
sudo hostnamectl set-hostname rocky-template.example.com
 

Procedure to change IP Settings

# List connections
nmcli connection show

# Show the current IP settings
ip a

# Modify the connection
nmcli connection modify ens192 ipv4.addresses 10.1.10.200/24
nmcli connection modify ens192 ipv4.gateway 10.1.10.254
nmcli connection modify ens192 ipv4.dns "1.1.1.1 8.8.8.8"
nmcli connection modify ens192 ipv4.method manual

# Restart Network Manager
sudo systemctl restart NetworkManager 

# show all current IP settings including default gateway
nmcli device show ens192
 

Procedure to change DNS Settings

sudo nmcli connection modify ens192 ipv4.dns "10.200.8.254"
sudo nmcli connection modify ens192 ipv4.dns-search "int.example.com"
sudo nmcli connection modify ens192  ipv4.ignore-auto-dns yes

# Restart Network Manager
sudo systemctl restart NetworkManager

cat /etc/resolv.conf
 

Procedure to set Time Servers 

To use above Time Servers, edit configuration file /etc/chrony.conf and ensure time servers are there.

# These servers could be used at the beginning of /etc/chrony.conf file
server time.cloudflare.com iburst
server time.google.com iburst
server ntp.cesnet.cz iburst

To enable and restart time service use

systemctl enable chronyd 
systemctl restart chronyd

# Check and Verify NTP time servers
chronyc sources -v
 

Procedure to set Time Zone

# Set Time Zone 
timedatectl set-timezone UTC
# Verify Time Zone  
timedatectl
 

Conclusion

Hope these basic operational procedures helps someone.


No comments:

Post a Comment

Rocky Linux - Basic Operational Procedures

Rocky Linux is an open-source, community-driven Linux distribution designed to be a bug-for-bug compatible downstream rebuild of Red Hat Ent...