1

I have SSH access to my server using a certificate. I have configured a user on the same server that would connect using a password, but using Putty, the server only seems to offer certificate login as I get the error:

"No supported authentication methods available (server sent publickey, gssapi-keyex, gssapi-with-mic)"

I did go into /etc/ssh/sshd_config to enable PasswordAuthentication yes and restarted sshd, but that does not seem to do anything. sshd_config has a line to include separate .conf files, which I have in /etc/ssh/sshd_config.d/50-redhat.conf. Here I also added PasswordAuthentication yes.

in /var/log/secure I find the following:

May 10 12:42:54 [user] sshd[2053]: Connection closed by authenticating user [user] [source-ip] port 60374 [preauth]

Just to be clear: I do not get the chance to put in a password.

Where else should I look to create the possibility of both certificate-based ánd password-based SSH access?

5
  • 3
    Care to provide the uncommented sections from your configuration files?
    – Ramhound
    Commented May 10, 2023 at 13:35
  • 1
    Or the output of the effective configuration using sudo sshd -T Commented May 10, 2023 at 14:50
  • I was providing the uncommented sections of /etc/ssh/sshd_config, when I found "PasswordAuthentication no" That would do it... Let me try again, and if it still doesn't work, I'll update the question with the requested outputs.
    – Bokkie
    Commented May 16, 2023 at 9:55
  • 2
    You seem to have solved the problem by yourself. The right procedure now is as follows: 1. Write a good answer. 2. Accept it. 3. Do not announce this fact in the title. Commented May 19, 2023 at 12:50
  • 1
    I am voting to close this question. The question was caused by a typo or trivial error (not using a configuration that allowed password authentication), which serves the community very little to submit an answer that makes the recommendation actually to enable password authentication.
    – Ramhound
    Commented May 19, 2023 at 12:58

2 Answers 2

2

Found my answer, leaving it here for posterity.

Issue seems to be that there are multiple ssh configs now, and not only /etc/ssh/sshd_config. In my case (ubuntu 22.04) there was a sneaky file /etc/ssh/sshd_config.d/60-cloudimg-settings.conf that had a single line PasswordAuthentication no that was WREAKING MY LIFE!!!!

Fixed it with this:

grep -r PasswordAuthentication /etc/ssh -l | xargs -n 1 sed -i 's/#\s*PasswordAuthentication\s.*$/PasswordAuthentication yes/; s/^PasswordAuthentication\s*no$/PasswordAuthentication yes/'

Also, service ssh restart was not working, no error, just didn't do anything and needed to use systemctl restart ssh.service instead.

1
  • this was there some weeks ago, how the hell did it get there, and what it is (i am on plesk and ubuntu 18 on aws) - anyone any ideas why is it there? didnt use to past few months..
    – psycho brm
    Commented Mar 22 at 14:07
-3

Set KbdInteractiveAuthentication to "yes" in sshd_config and restart. PasswordAuthentication is not enough

4
  • Not true, they are different, independent methods. For your information: the OP has solved the problem but neglected to post a proper answer. See the revision history and comments under the question. Commented Dec 22, 2023 at 20:31
  • I’ve been posting this answer when I had the problem myself and this was the fix. I hope to save one hour to whoever arrives here after failing trying other solutions. Getting unlikes will just hide one of the possible answers from those needing it.
    – Jorj
    Commented Dec 24, 2023 at 19:19
  • PasswordAuthentication yes should work, so maybe you have PasswordAuthentication no earlier in the file. IMO advising KbdInteractiveAuthentication yes because allegedly "PasswordAuthentication is not enough" without any explanation or insight is voodoo. "Do this. Period." is not a good answer, it's mediocre at best. "Do this. [False statement here]." is worse, even if it "works". The point is we should not promote voodoo. If the answer shows insight then I will revoke my downvote. Commented Dec 24, 2023 at 19:45
  • Right. There is a teacher for every student. I have limited knowledge about this, so my answer is the best I could provide. Ps. i DID have PasswordAuthentication yes and it made no difference, against all readings I could find.
    – Jorj
    Commented Dec 25, 2023 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .