keepcalculator

06 Numbers and Powers

Things to Do After Minimal RHEL/CentOS Install

Card No. 06·87411 · Updated · Standard formula, shown below

After installing a minimal RHEL or CentOS system, you get a bare command line with no GUI, no development tools, and no extra packages. The first tasks are to connect to the network, update the system, set the hostname, configure time sync, enable essential repositories, and install the tools you need for your specific role. This guide walks through the standard post-install steps in order, with exact commands for current RHEL 9 and CentOS Stream 9 systems.

Why Minimal Installs Need Extra Setup

A minimal installation intentionally includes only the base packages needed to boot and run a basic system. That means no sudo (you use su to become root), no vim or nano (just vi), no wget or curl, no tar with compression support, and no firewalld by default. The package manager dnf is present, but the system may not have network access until you configure it. You also won’t have a graphical interface, which is fine for servers but requires you to work from the command line.

The goal of post-install setup is to turn that bare base into a usable, secure, and maintainable server or workstation. The exact steps depend on whether you’re using RHEL (which requires a subscription) or CentOS Stream (which uses the free CentOS repositories).

Step 1: Connect to the Network

If your system didn’t get an IP address during installation (common on servers without DHCP), you need to configure networking manually. Check current state with:

ip addr show
ip route show

If you see no IP on your interface (e.g., eth0 or ens3), run nmtui (text user interface for NetworkManager) to activate a connection. If nmtui isn’t installed, you can edit the interface config file directly:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

Set BOOTPROTO=dhcp and ONBOOT=yes, then restart networking with systemctl restart NetworkManager. For static IPs, fill in IPADDR, NETMASK, GATEWAY, and DNS1. After connecting, test with ping -c 4 google.com.

Step 2: Update the System

Before doing anything else, update all base packages to get the latest security fixes. As root:

dnf update -y

If you’re on RHEL, you must register the system first or the update will fail. Use subscription-manager register --username your_username and then attach a subscription. CentOS Stream doesn’t require registration. After updating, reboot if the kernel was updated: reboot.

Step 3: Set Hostname and Time Synchronization

Set a meaningful hostname (e.g., web01) with:

hostnamectl set-hostname web01

Verify with hostnamectl. For time sync, install and enable chrony:

dnf install -y chrony
systemctl enable --now chronyd

Check status with chronyc tracking. If you need to change the timezone, use timedatectl set-timezone America/New_York (list zones with timedatectl list-timezones).

Step 4: Enable Repositories and Install Essential Tools

For RHEL, enable the optional and extras repos with subscription-manager repos --enable rhel-9-for-x86_64-optional-rpms and similar. For CentOS Stream, the default baseos and appstream repos are already enabled. Add EPEL (Extra Packages for Enterprise Linux) for additional software:

dnf install -y epel-release

Then install a basic set of tools that most admins need:

  • sudo – to grant admin rights to non-root users
  • vim or nano – a friendly text editor
  • wget and curl – for downloading files
  • tar and bzip2 – for archive extraction
  • firewalld – for firewall management
  • net-tools – for ifconfig and netstat (optional)
  • bash-completion – for tab completion in the shell

Run: dnf install -y sudo vim wget curl tar bzip2 firewalld bash-completion

If you plan to compile software, also install gcc, make, and kernel-devel.

Step 5: Create a Regular User and Configure sudo

Working as root is risky. Create a normal user with:

useradd -m -G wheel username
passwd username

Adding the user to the wheel group allows them to use sudo. Test with su - username then sudo whoami. If sudo prompts for a password, it’s working. If you want passwordless sudo for that user, edit /etc/sudoers.d/username and add:

username ALL=(ALL) NOPASSWD: ALL

But that’s less secure and generally not recommended.

Step 6: Configure the Firewall and SELinux

Enable and start the firewall:

systemctl enable --now firewalld
firewall-cmd --state

Open only the ports you need. For a web server: firewall-cmd --permanent --add-service=http and --add-service=https, then firewall-cmd --reload. For SSH, the default port 22 is usually already allowed. Check with firewall-cmd --list-all.

SELinux is enabled by default in enforcing mode. Check with getenforce. If you’re not familiar, leave it enforcing – most services have correct policies. If you need to temporarily disable it for testing, use setenforce 0, but change /etc/selinux/config to permissive only if you understand the risks. For a production system, keep enforcing and troubleshoot with ausearch -m avc.

Step 7: Install and Configure SSH (if not already)

Minimal installs usually include OpenSSH server, but if not, install it:

dnf install -y openssh-server
systemctl enable --now sshd

Harden SSH by editing /etc/ssh/sshd_config: disable root login (PermitRootLogin no), disable password authentication if you use keys (PasswordAuthentication no), and change the port if you want. Always test that you can log in from another terminal before closing your current session.

Step 8: Set Up Automatic Updates and Log Rotation

Install dnf-automatic to apply security updates automatically:

dnf install -y dnf-automatic
systemctl enable --now dnf-automatic.timer

Configure /etc/dnf/automatic.conf to set apply_updates = yes if you want it to install without manual approval. Log rotation is already handled by logrotate, but you can adjust /etc/logrotate.conf if needed.

Common Mistakes to Avoid

  • Forgetting to enable the network interface after a static IP – always set ONBOOT=yes.
  • Running dnf update before registering RHEL – it will fail with a subscription error.
  • Disabling SELinux entirely instead of fixing the policy – this reduces security.
  • Opening all ports in the firewall – only expose what’s necessary.
  • Not creating a non-root user – you’ll be stuck using root and risk accidental damage.

Frequently Asked Questions

Do I need a subscription for RHEL minimal install?

Yes, RHEL requires a subscription to access the software repositories. You can get a free developer subscription for up to 16 systems if you have a Red Hat account. Without a subscription, you cannot run dnf update or install packages. CentOS Stream is free and doesn’t require registration.

Can I install a GUI later on a minimal system?

Yes. Use dnf groupinstall "Server with GUI" or dnf groupinstall "Workstation" (RHEL/CentOS 9). This installs GNOME or KDE depending on the group. After installation, set the default target to graphical with systemctl set-default graphical.target and reboot.

What is EPEL and why should I install it?

EPEL (Extra Packages for Enterprise Linux) is a repository maintained by the Fedora project that provides many additional packages not in the base RHEL/CentOS repos. It’s safe and widely used. Install with dnf install epel-release. It gives you access to tools like htop, jq, and many others.

How do I change the hostname after installation?

Use hostnamectl set-hostname newname. To make it permanent, edit /etc/hostname and ensure /etc/hosts has an entry mapping the new name to your IP. Then restart the system or at least the network service.

Should I disable IPv6 if I don’t use it?

It’s generally not recommended to fully disable IPv6, as many services and tools expect it. Instead, you can configure NetworkManager to ignore IPv6 on specific interfaces by editing the connection profile and setting IPV6INIT=no. But leaving it enabled doesn’t cause problems on most systems.

What’s the difference between CentOS Stream and RHEL for this setup?

CentOS Stream is a rolling release that sits between Fedora and RHEL, while RHEL is the stable enterprise release. For post-install steps, the commands are nearly identical. The main difference is that RHEL requires subscription registration, and CentOS Stream uses the CentOS repos instead. Both use dnf and the same systemd commands.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →