Study guide

14.2 Configure autofs

Red Hat Certified System Administrator RHCSA

Track your progress as you read

Finished sections get a check mark.

1 Introduction & Exam Overview

1.1 Current Exam Facts 1.2 Lab Setup & Performance-Based Study Strategy

2 Essential Tools: Shell, Redirection & Text Analysis

2.1 Shell Prompt and Command Syntax 2.2 Input-Output Redirection and Pipes 2.3 grep and Regular Expressions for Text Analysis

3 Essential Tools: Remote Access, Users & Text Editing

3.1 Access Remote Systems Using SSH 3.2 Log In and Switch Users in Multiuser Targets 3.3 Create and Edit Text Files

4 Essential Tools: Files, Links & Archives

4.1 Create, Delete, Copy, and Move Files and Directories 4.2 Hard and Soft Links 4.3 Archive and Compress with tar, gzip, and bzip2

5 Essential Tools: Permissions & System Documentation

5.1 List, Set, and Change Standard ugo/rwx Permissions 5.2 System Documentation: man, info, and /usr/share/doc

6 Manage Software: RPM and Flatpak

6.1 Configure Access to RPM Repositories 6.2 Install and Remove RPM Software Packages 6.3 Configure Access to Flatpak Repositories 6.4 Install and Remove Flatpak Software Packages

7 Create Simple Shell Scripts

7.1 Conditional Execution: if, test, and [] 7.2 Looping Constructs for Files and Input 7.3 Process Script Inputs ($1, $2, and Beyond) 7.4 Process Shell Command Output in Scripts

8 Operate Running Systems: Boot and Recovery

8.1 Boot, Reboot, and Shut Down a System Normally 8.2 Boot Systems into Different Targets Manually 8.3 Interrupt the Boot Process to Gain Access

9 Operate Running Systems: Processes and Tuning

9.1 Identify and Kill CPU/Memory Intensive Processes 9.2 Adjust Process Scheduling 9.3 Manage Tuning Profiles

10 Operate Running Systems: Logs, Services & File Transfer

10.1 Locate and Interpret System Log Files and Journals 10.2 Preserve System Journals 10.3 Start, Stop, and Check Status of Network Services 10.4 Securely Transfer Files Between Systems

11 Configure Local Storage: Partitions and LVM

11.1 List, Create, and Delete Partitions on GPT Disks 11.2 Create and Remove Physical Volumes 11.3 Assign Physical Volumes to Volume Groups 11.4 Create and Delete Logical Volumes

12 Configure Local Storage: Mounting and Expansion

12.1 Mount File Systems at Boot by UUID or Label 12.2 Add Partitions, Logical Volumes, and Swap Non-Destructively

13 Create and Configure File Systems: Local FS and Permissions

13.1 Create, Mount, and Use VFAT, ext4, and XFS File Systems 13.2 Extend Existing Logical Volumes 13.3 Diagnose and Correct File Permission Problems

14 Create and Configure File Systems: NFS and autofs

14.1 Mount and Unmount Network File Systems Using NFS 14.2 Configure autofs

15 Deploy and Maintain: Scheduling, Services & Targets

15.1 Schedule Tasks with at, cron, and systemd Timers 15.2 Start, Stop, and Enable Services at Boot 15.3 Configure Systems to Boot into a Specific Target

16 Deploy and Maintain: Time, Software Updates & Bootloader

16.1 Configure Time Service Clients 16.2 Install and Update Software from CDN, Remote Repos, and Local Files 16.3 Modify the System Bootloader

17 Manage Basic Networking

17.1 Configure IPv4 and IPv6 Addresses 17.2 Configure Hostname Resolution 17.3 Configure Network Services to Start Automatically at Boot 17.4 Restrict Network Access Using firewalld and firewall-cmd

18 Manage Users and Groups

18.1 Create, Delete, and Modify Local User Accounts 18.2 Change Passwords and Adjust Password Aging 18.3 Create, Delete, and Modify Local Groups and Memberships 18.4 Configure Privileged Access

19 Manage Security: Firewall, umask & SSH Keys

19.1 Configure Firewall Settings with firewall-cmd and firewalld 19.2 Manage Default File Permissions 19.3 Configure Key-Based Authentication for SSH

20 Manage Security: SELinux Modes and Contexts

20.1 Set Enforcing and Permissive Modes for SELinux 20.2 List and Identify SELinux File and Process Contexts 20.3 Restore Default File Contexts

21 Manage Security: SELinux Ports and Booleans

21.1 Manage SELinux Port Labels 21.2 Use Boolean Settings to Modify SELinux Settings

14.2 Configure autofs

Key Takeaways Explain This Topic AI

autofs mounts file systems on demand when a path under a managed base is accessed, and can unmount them after idle timeout—ideal for NFS home or shared trees.

Master map /etc/auto.master (or auto.master.d drop-ins) points mount bases to map files; indirect maps list keys relative to that base.

Install and enable the service with systemctl enable --now autofs (or enable + start); reload maps after edits with systemctl reload autofs.

Typical indirect NFS line: key -options server:/export/key or wildcard * -options server:/export/& for home directories.

Exam success is accessing the autofs path so the NFS share appears automatically and configuration survives reboot via enabled autofs—not only a static mount -t nfs.

Last updated: August 2026

14.2 Configure autofs

Quick Answer: Install autofs , define a master map entry and an indirect map for your NFS keys, then systemctl enable --now autofs . Access /base/key to trigger the mount; confirm with findmnt . On EX200, autofs is the tool for on-demand mounts that should not sit in fstab as always-mounted NFS.

Official skill and why it matters

Under Create and configure file systems , Red Hat expects you to configure autofs . Lab language often looks like:

  • “Configure autofs to mount server:/exports/homes/username at /homes/username when accessed.”
  • “Users’ home directories under /home should automount from NFS using autofs.”
  • “Set up an indirect autofs map so /mnt/projects/alpha mounts nfs.example.com:/exports/projects/alpha .”

autofs (the automount program managed by the autofs systemd unit) watches configured directories and mounts only when something looks up a key under that directory. After idle time, it can unmount again. That differs from a permanent fstab NFS mount, which is intended to stay mounted after boot/ mount -a .

autofs vs static NFS mount

  • Approach When it mounts Typical use
  • mount -t nfs / fstab nfs Boot or manual mount -a Always-needed shares
  • autofs On first access to the path Homes, many project shares, optional branches

If the task says autofs , automount , or “when the user accesses,” do not only add fstab. If the task says “mount at boot permanently,” fstab NFS (14.1) is usually enough. Read the verb carefully.

  • Package and service sudo dnf install -y autofs
  • rpm -q autofs
  • systemctl status autofs
  • sudo systemctl enable --now autofs

# equivalent stepwise:

  • # sudo systemctl enable autofs
  • # sudo systemctl start autofs

systemctl enable autofs (or enable --now ) makes the service start at boot so maps survive reboot—the EX200 persistence rule applies to the service , not to keeping every NFS share permanently mounted.

After changing maps: sudo systemctl reload autofs

# if reload is insufficient in a broken state:

  • sudo systemctl restart autofs
  • Verify the unit: systemctl is-enabled autofs
  • systemctl is-active autofs
  • Master map: /etc/auto.master and drop-ins

The master map lists mount points (bases) and which map defines keys under them.

  • Classic file: /etc/auto.master # mount-point map-file options
  • /homes /etc/auto.homes
  • /mnt/projects /etc/auto.projects --timeout=60

Modern RHEL also uses drop-in directories such as /etc/auto.master.d/ with files ending in .autofs : # Example: /etc/auto.master.d/homes.autofs

/homes /etc/auto.homes

Either style works if the master configuration ultimately includes your base and map path. Prefer matching existing host style: if the system already uses auto.master.d , add a drop-in there; otherwise a clear line in /etc/auto.master is fine for exams.

Master map fields (mental model)

  • Field Role
  • Mount point Parent directory autofs manages (e.g. /homes )
  • Map File, program, or LDAP map defining keys (exam: almost always a file )
  • Options Optional timeouts and global options for that map

Indirect mounts (the EX200 workhorse): keys are subdirectories of the mount point. Accessing /homes/alice looks up key alice in the map for /homes .

Direct maps use absolute key paths in a special /- master entry—less common on RHCSA labs. Master indirect unless the task explicitly demands direct maps.

  • Indirect map files
  • Example /etc/auto.homes : # key [mount-options] location
  • alice -fstype=nfs,rw server1.example.com:/exports/homes/alice
  • bob -fstype=nfs,rw server1.example.com:/exports/homes/bob
  • Access: ls /homes/alice
  • # automount triggers → NFS mounts server1:/exports/homes/alice on /homes/alice
  • findmnt /homes/alice
  • Wildcard maps for home directories
  • When every user key maps to the same pattern on the server, use * and & : # /etc/auto.homes
  • * -fstype=nfs,rw server1.example.com:/exports/homes/&
  • Token Meaning
  • * Match any key (alice, bob, …)
  • & Substitute the key name into the location

So access to /homes/carol mounts server1.example.com:/exports/homes/carol .

This pattern is extremely common for “automount NFS homes” tasks.

Options placement

Options can sit:

  • In the map line after the key: -fstype=nfs,rw,soft
  • In the master map for the whole map: --timeout=60

Sometimes in /etc/autofs.conf for global defaults (timeouts, logging)—edit maps first on timed exams unless the task points at conf. # Map line with options

projects -fstype=nfs,rw,soft storage.example.com:/exports/projects

For NFS, fstype=nfs (or nfs4 ) should match what works with manual mount -t nfs on that server.

Permissions and the base directory

The master mount point (e.g. /homes ) is managed by automount. Do not permanently mount something else on the same path.

You generally do not pre-create every key subdirectory; autofs creates the mountpoint when the key is accessed.

Local files already sitting under /homes can hide or conflict with automount keys—keep the base clean for automounted content.

  • End-to-end exam workflows
  • Workflow A — Indirect map for one project share

Task: When /mnt/data/report is accessed, mount nfs.lab.example.com:/exports/report using autofs; enable for boot. sudo dnf install -y autofs

# Master (or auto.master.d drop-in):

# /mnt/data /etc/auto.data

  • echo '/mnt/data /etc/auto.data' | sudo tee -a /etc/auto.master
  • # Safer on some systems: create /etc/auto.master.d/data.autofs with that line instead
  • cat <<'EOF' | sudo tee /etc/auto.data
  • report -fstype=nfs,rw nfs.lab.example.com:/exports/report
  • EOF
  • sudo systemctl enable --now autofs
  • sudo systemctl reload autofs
  • ls /mnt/data/report
  • findmnt /mnt/data/report
  • Workflow B — NFS homes with wildcard
  • Task: Automount each user’s directory from utility:/homes/& under /remote/homes . sudo dnf install -y autofs
  • # /etc/auto.master.d/remotehomes.autofs
  • echo '/remote/homes /etc/auto.remotehomes' | sudo tee /etc/auto.master.d/remotehomes.autofs
  • cat <<'EOF' | sudo tee /etc/auto.remotehomes
  • * -fstype=nfs,rw utility.example.com:/homes/&
  • EOF
  • sudo systemctl enable --now autofs
  • sudo systemctl reload autofs
  • ls /remote/homes/student1
  • findmnt /remote/homes/student1
  • (Replace host/export with the task’s values; ensure nfs-utils works for NFS client mounts as in 14.1.)
  • Workflow C — Verify service without mounting everything systemctl status autofs

# Trigger one key only:

  • ls /homes/alice
  • mount | grep -E 'nfs|autofs'

Idle unmount may remove the NFS mount after the configured timeout— re-access the path if findmnt is empty later; that still proves autofs works.

  • Workflow D — Broken map fix # Access fails or mounts wrong export
  • sudo cat /etc/auto.master /etc/auto.master.d/* 2>/dev/null
  • sudo cat /etc/auto.homes
  • sudo systemctl restart autofs
  • journalctl -u autofs -e --no-pager
  • # Fix typos in key, server, or export; reload/restart; test again
  • Map syntax traps

Master points to wrong map path — /etc/auto.homes vs where you wrote the file.

Key name mismatch — map key alice but user accesses /homes/Alice (case matters).

Forgetting * / & pairing — * without & will not expand the export path correctly for each user.

Using fstab and autofs on the same mountpoint — conflicts; pick one per task.

Service not enabled — works until reboot, then automount dies.

NFS server path wrong — same as 14.1; test with manual mount -t nfs once if allowed, then put the working location into the map.

Spaces and comment errors — keep map lines clean; # starts comments.

Mount point is a file not a directory — rare, but broken bases fail activation.

Configuration file checklist

  • File Purpose
  • /etc/auto.master Master map (bases → maps)
  • /etc/auto.master.d/*.autofs Drop-in master fragments
  • /etc/auto.* custom maps Indirect keys and NFS locations
  • /etc/autofs.conf Global daemon defaults (timeouts, logging)
  • systemd unit autofs Start/enable/reload service
  • Interaction with NFS client skills

autofs still uses the NFS client stack . If manual mount -t nfs server:/export /mnt/test fails, autofs will also fail for that location. Fix network, nfs-utils , firewall on the server side, and export path first. Then encode the working server:/export into the map.

showmount -e server (14.1) still helps discover export paths for map lines when available.

Logging and timeouts

Default idle unmount timeouts vary by configuration ( TIMEOUT in autofs.conf or master --timeout= ).

Short timeouts can confuse testers who findmnt after waiting—re-access the path.

For exams, default timeouts are usually fine unless the task sets a specific timeout. grep -E '^(TIMEOUT|MOUNT_WAIT)' /etc/autofs.conf 2>/dev/null

Common traps

Only installing autofs without maps — service runs but nothing mounts.

Editing maps without reload/restart — old maps remain active.

Putting full absolute paths as keys in an indirect map — keys are relative ( alice , not /homes/alice ).

Expecting mount at boot without access — autofs is on-demand; grader may ls the path to trigger.

Disabling autofs after testing — leave it enabled .

SELinux denials — less common for simple NFS automount; check ausearch / journalctl if mounts are denied after syntax is correct.

Firewall blocking NFS — same class of failures as static NFS.

Confusing master options with map options — master --timeout=60 vs map -fstype=nfs .

Relationship to other objectives

  • Skill Where
  • Static NFS mount/umount/fstab Section 14.1
  • autofs master/maps/service This section
  • Local mounts by UUID Storage chapters
  • User home creation Users and groups chapter (homes may be local or NFS via autofs)
  • Section checkpoint

You should install autofs, write a master map entry (auto.master or auto.master.d), create an indirect map with explicit keys or * / & wildcards for NFS locations, enable and start the service with systemctl enable --now autofs , reload after edits, and verify by accessing /base/key and checking findmnt . That is the EX200 bar for configuring autofs so network file systems appear on demand and the configuration survives reboot.