Question
How do I enable or disable PasswordAuthentication in SSH?
Answer
The PasswordAuthentication option determines your ability to authenticate with a password via SSH. Password authentication is enabled in SSH by default.
- Access your server using SSH as the root user.
- Open the file
/etc/ssh/sshd_configusing your preferred command-line editor. Search for a line starting with the following:
CONFIG_TEXT: PasswordAuthentication
To disable password authentication in SSH, set this option to "no":
CONFIG_TEXT: PasswordAuthentication no
To enable password authentication, set this option to "yes":
CONFIG_TEXT: PasswordAuthentication yes
Save the file and restart SSHd to apply the changes:
# /scripts/restartsrv_sshd
- Access your server using SSH as the root user.
- Open the file
/etc/ssh/sshd_config.d/000-cpanel-options.confusing your preferred command-line editor. Search for a line starting with the following:
CONFIG_TEXT: PasswordAuthentication
If one does not already exist, add one of the next lines to the end of the file.
To disable password authentication in SSH, set this option to "no":
CONFIG_TEXT: PasswordAuthentication no
To enable password authentication, set this option to "yes":
CONFIG_TEXT: PasswordAuthentication yes
Save the file and restart SSHd to apply the changes:
# /scripts/restartsrv_sshd
Comments
0 comments
Article is closed for comments.