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.
Question
Options
- ANoRootLogon
- BPermitRootLogin No
- CNoRootLogon Yes
- DRootLogin = No
- EProhibitRootLogon No
How the community answered
(63 responses)- A8% (5)
- B86% (54)
- C3% (2)
- D2% (1)
- E2% (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.
`NoRootLogon` is not a valid directive in the `sshd_config` file.
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.
`NoRootLogon Yes` is not a valid directive in the `sshd_config` file.
`RootLogin = No` is not the correct syntax for the `sshd_config` directive; `PermitRootLogin` is the accurate keyword.
`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
Community Discussion
No community discussion yet for this question.