CompTIA Linux+ (XK0-005) — Question 253

Which of the following will prevent non-root SSH access to a Linux server?

Answer options

Correct answer: A

Explanation

Creating the /etc/nologin file effectively prevents all non-root users from logging in to the server, as it signals that the system is not accepting non-root user logins. The other options either do not effectively restrict access or are incorrectly configured to allow certain users access rather than blocking all non-root connections.