nerdexam
Linux_Foundation

LFCS · Question #455

Which configuration option can you use to prevent the root user from logging directly onto a machine using ssh?

The correct answer is B. PermitRootLogin No. To prevent the root user from logging in directly via SSH, the PermitRootLogin No directive is used in the sshd_config file.

Submitted by carter_n· Apr 18, 2026Service Configuration

Question

Which configuration option can you use to prevent the root user from logging directly onto a machine using ssh?

Options

  • ANoRootLogon
  • BPermitRootLogin No
  • CNoRootLogon Yes
  • DRootLogin = No
  • EProhibitRootLogon No

How the community answered

(63 responses)
  • A
    8% (5)
  • B
    86% (54)
  • C
    3% (2)
  • D
    2% (1)
  • E
    2% (1)

Why each option

To prevent the root user from logging in directly via SSH, the `PermitRootLogin No` directive is used in the `sshd_config` file.

ANoRootLogon

`NoRootLogon` is not a valid directive in the `sshd_config` file.

BPermitRootLogin NoCorrect

The `PermitRootLogin` directive in the `/etc/ssh/sshd_config` file, when set to `No`, specifically prevents the root user from logging in directly via SSH. This is a common security best practice to force users to log in as a regular user first and then `su` or `sudo` to root.

CNoRootLogon Yes

`NoRootLogon Yes` is not a valid directive in the `sshd_config` file.

DRootLogin = No

`RootLogin = No` is not the correct syntax for the `sshd_config` directive; `PermitRootLogin` is the accurate keyword.

EProhibitRootLogon No

`ProhibitRootLogon No` is not a valid directive in `sshd_config`.

Concept tested: SSH server security configuration (`sshd_config`)

Source: https://www.man7.org/linux/man-pages/man5/sshd_config.5.html

Topics

#SSH#Security#Root Login#Service Configuration

Community Discussion

No community discussion yet for this question.

Full LFCS Practice