To disable root login via SSH, which file must be edited?

Enhance your IT career with CompTIA Server+ Exam prep. Study anytime with flashcards and engaging multiple choice questions. Detailed explanations at your fingertips!

Multiple Choice

To disable root login via SSH, which file must be edited?

Explanation:
The correct choice, which is to edit the /etc/ssh/sshd_config file, is significant because this file contains the configuration settings for the SSH daemon (sshd). One of the directives you can set in this configuration file is "PermitRootLogin". By changing this directive to "no", you can effectively disable direct root login over SSH, enhancing the security of the server. Disabling root login via SSH is a recommended security practice, as it reduces the attack surface by preventing external access to the root account. Instead, users can log in with their own accounts and then use commands like 'sudo' to perform administrative tasks, which also provides an audit trail of user actions. The other choices pertain to different functions within a Linux system. /etc/hosts is used for hostname resolution, /etc/network/interfaces is relevant for network configuration settings, and /home/user/.bashrc is a script that is executed whenever a new terminal session is started for a specific user, primarily used for user environment settings. None of these files control settings related to SSH access and therefore would not help in disabling root login.

The correct choice, which is to edit the /etc/ssh/sshd_config file, is significant because this file contains the configuration settings for the SSH daemon (sshd). One of the directives you can set in this configuration file is "PermitRootLogin". By changing this directive to "no", you can effectively disable direct root login over SSH, enhancing the security of the server.

Disabling root login via SSH is a recommended security practice, as it reduces the attack surface by preventing external access to the root account. Instead, users can log in with their own accounts and then use commands like 'sudo' to perform administrative tasks, which also provides an audit trail of user actions.

The other choices pertain to different functions within a Linux system. /etc/hosts is used for hostname resolution, /etc/network/interfaces is relevant for network configuration settings, and /home/user/.bashrc is a script that is executed whenever a new terminal session is started for a specific user, primarily used for user environment settings. None of these files control settings related to SSH access and therefore would not help in disabling root login.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy