I've tried enabling SSH logins in my linux server. It can establish connection just fine trough my private key. I also went to /etc/ssh/ssh_config and edited the following field like this:

PasswordAuthentication no

But it still lets me login trough a username/password when I use putty or winSCP. Right now I can login both from user/password and SSH keys, which is rather pointless as far as security goes. What else do I need to do to ONLY allow SSH logins?

  • 1
    You are editing the wrong file. SSH server config is under /etc/ssh/sshd_config Dec 4, 2015 at 9:19
  • ah yes, my bad. I also had to change these 2 options: PasswordAuthentication no ChallengeResponseAuthentication no and restart the server
    – jonnybravo
    Dec 4, 2015 at 9:27

1 Answer 1


You need to modify different file /etc/ssh/sshd_config and you need to disable also ChallengeResponseAuthentication like this:

ChallengeResponseAuthentication no
PasswordAuthentication no

and restart the service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.