0

I have created an EC2 instance that runs FreeBSD, and I can log into it using my SSH key and the default user ec2-user. I logged into it, and switched to root using su. I then created a personal account using adduser, and enabled password authentication and typed in a password.

When I tried to log into my account using PuTTY, I got the error "No supported authentication methods available (server sent: publickey)".

I have already enabled password authentication using PasswordAuthentication yes in my sshd config.

  • Did you restart the sshd service after changing the config? – D_Bye Apr 15 at 10:45
  • yes. (insert filler text here so i can make a comment) – xcrafter_40 Apr 15 at 19:07
  • Check for clues in the EC2 instance's /var/log/auth.log. FWIW, I have never needed PasswordAuthentication yes. FreeBSD's default sshd configuration defaults to PAM-based authentication, which includes password auth and public key auth. Also, you can test by ssh-ing from the instance to the instance. Login as ec2-user, then say $ ssh myaccount@localhost or some other appropriate hostname instead of localhost. Perhaps the FreeBSD ssh client will give you more useful debugging output than Putty does. – Jim L. Apr 16 at 18:15
  • Just checked auth.log, this is what it said when I tried to auth: Apr 17 02:27:16 freebsd sshd[57154]: user wmin login class [preauth] Apr 17 02:27:16 freebsd syslogd: last message repeated 1 times Apr 17 02:27:16 freebsd sshd[57154]: error: Received disconnect from my ip address port 59670:14: No supported authentication methods available [preauth] Apr 17 02:27:16 freebsd sshd[57154]: Disconnected from authenticating user wmin my ip address port 59670 [preauth] – xcrafter_40 Apr 17 at 2:28
  • FreeBSD client shows the same thing: wmin@localhost: Permission denied (publickey). – xcrafter_40 Apr 17 at 2:32

Your Answer

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

Browse other questions tagged or ask your own question.