LX0-104 · 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. The SSH server configuration file, sshd_config, contains a specific directive to control whether the root user is allowed to log in directly via SSH.
Question
Options
- ANoRootLogon
- BPermitRootLogin No
- CNoRootLogon Yes
- DRootLogin = No
- EProhibitRootLogon No
How the community answered
(28 responses)- B86% (24)
- C4% (1)
- D4% (1)
- E7% (2)
Why each option
The SSH server configuration file, `sshd_config`, contains a specific directive to control whether the root user is allowed to log in directly via SSH.
`NoRootLogon` is not a standard or recognized directive in the `sshd_config` file for preventing root login.
The `PermitRootLogin No` directive in the SSH server's configuration file (`/etc/ssh/sshd_config`) prevents the root user from logging in directly via SSH for security reasons, often requiring users to log in as a regular user and then use `su` or `sudo`.
`NoRootLogon Yes` is not a standard `sshd_config` directive.
`RootLogin = No` is not the correct syntax or directive for preventing root login in `sshd_config`; the correct directive is `PermitRootLogin`.
`ProhibitRootLogon No` is not a standard or recognized directive in the `sshd_config` file.
Concept tested: SSH server security configuration for root login
Source: https://man7.org/linux/man-pages/man5/sshd_config.5.html
Topics
Community Discussion
No community discussion yet for this question.