I cant find the line "PasswordAuthentication no " with sudo nano /etc/shh/shhd_config command

October 4, 2017 713 views
Security Ubuntu 16.04

To disable Password Authentication after sshkey been added to home directory for user.

2 Answers

Instead using nano when you can't find that line try to grep that string to find out if it's really there (Maybe you can't see it ;) )

grep -n PasswordAuthentication  /etc/ssh/sshd_config

It will give you also the line number in file where it is exactly. If there will be nothing, so just try to put that parameter to that file and restart sshd

Hi ebbergh,

It happens to me as well. So, I search sshd_config first, and then I go to the directory like this.

find / -name sshd_config

The directory is /etc/ssh/sshd_config. Use the command below to go to the directory.

cd /etc/ssh/

Once you go to the directory, you will see PasswordAuthentication No when you type the command below.

Pico sshd_config

Hope my comment can help you:)

Have another answer? Share your knowledge.