What is PermitRootLogin?

PermitRootLogin is a configuration option in the SSH server settings (typically found in the sshd_config file) that controls whether the root user is allowed to log in via SSH. Here are the possible values for this option:

  1. yes: Allows root login via SSH. This is generally not recommended due to security risks.

  2. no: Disables root login via SSH. This is the recommended setting for better security.

  3. prohibit-password: Allows root login only with public key authentication, not with password authentication.

  4. forced-commands-only: Allows root login only for specific commands when using public key authentication.

To set this option, you would typically edit the sshd_config file (usually located at /etc/ssh/sshd_config) and add or modify the line:

PermitRootLogin no

After making changes, restart the SSH service for them to take effect. Disabling root login enhances security by requiring users to log in with their own accounts and use sudo for administrative tasks.

0 Comments

no data
Be the first to share your comment!