Red Hat Certified System Administrator RHCSA · Free Practice Question Medium

Question 17

How can you configure a Red Hat Enterprise Linux 9 system (specifically, the 'linux2.lab' server) to prevent direct root logins over SSH?

Show model answer

In RHEL 9, to restrict direct root SSH login on 'linux2.lab', edit the SSH configuration file '/etc/ssh/sshd_config'. Change the line 'PermitRootLogin yes' to 'PermitRootLogin no'. Then, restart the SSHD service with 'sudo systemctl restart sshd'. This change prohibits root user logins directly via SSH, enhancing the server's security.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need