312-40 practice question 22 of 25

Kevin Ryan has been working as a cloud security engineer over the past 2 years in a multinational company, which uses AWS-based cloud services. He…

Full set: 147 questions
Kevin Ryan has been working as a cloud security engineer over the past 2 years in a multinational company, which uses AWS-based cloud services. He launched an EC2 instance with Amazon Linux AMI. By disabling password-based remote logins, Kevin wants to eliminate all possible loopholes through which an attacker can exploit a user account remotely. To disable password-based remote logins, using the text editor, Kevin opened the /etc/ssh/sshd_config file and found the #PermitRootLogin yes line. Which of the following command lines should Kevin use to change the #PermitRootLogin yes line to disable password-based remote logins?
Answer options
A: PermitRootLogin without-password Correct answer
B: PermitRootLogin without./password/disable
C: PermitRootLogin without./password
D: PermitRootLogin without-password/disable
Correct Answer:
A. PermitRootLogin without-password
Explanation

The option PermitRootLogin without-password in the /etc/ssh/sshdconfig file configures the SSH daemon to allow root user login but only through non-password authentication methods, such as public key authentication (SSH keys). This meets the security goal of disabling password-based logins, which are vulnerable to brute-force attacks, while still allowing authorized administrative access using more secure key-based methods. The other options represent syntactically incorrect values for this directive.

Why Incorrect

B. PermitRootLogin without./password/disable is not a valid parameter for the PermitRootLogin directive. The syntax is incorrect.
C. PermitRootLogin without./password is not a valid parameter for the PermitRootLogin directive. The syntax is incorrect.
D. PermitRootLogin without-password/disable is not a valid parameter for the PermitRootLogin directive. The syntax is incorrect.

References

1. OpenBSD. (2023). sshdconfig(5) - OpenBSD manual pages. Retrieved from https://man.openbsd.org/sshdconfig.5. (Under the PermitRootLogin section, it specifies without-password as a valid argument that disables password authentication for root).

2. Amazon Web Services. (2023). Connect to your Linux instance. EC2 User Guide for Linux Instances. Retrieved from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html. (This guide emphasizes the use of key pairs for authentication, which is the method enabled by without-password).

3. Red Hat. (2023). Chapter 9. Securing SSH. Red Hat Enterprise Linux 8 Documentation. Retrieved from https://access.redhat.com/documentation/en-us/redhatenterpriselinux/8/html/configuringandmanagingnetworking/securing-sshconfiguring-and-managing-networking. (Section 9.2 discusses modifying sshdconfig and hardening practices, including disabling root password login).

Scroll to Top