12

Trying to SSH using a user account; root account works but I am specifying a private key. User account simply gives "Permission denied (publickey,gssapi-with-mic) without prompting me for my password at all.

How can I fix this so I can log in with a password, and NOT a key? I don't want to use a private key for this right now, but a regular account.

  • 4
    Key-based authentication still logs you into a "regular" account... – womble Dec 31 '09 at 0:15
27

The server has setting

 PasswordAuthentication no 

Change it to yes and after a restart you'll be able to use password authentication.

  • 2
    In case anyone doesn't know, the PasswordAuthentication setting is in /etc/ssh/sshd_config. – pacoverflow Oct 26 '18 at 22:34
7

Check your login sequence with ssh -vv. This will tell you what authentication methods are tried and which fail. You can then enable what you want and disable what you don't want. Enable first, of course.

3

You will also need to edit /etc/ssh/sshd_config to have the setting:

ChallengeResponseAuthentication yes

as well as...

PasswordAuthentication yes

And remember to run /user/sbin/service ssh restart afterwards to pick up the new settings.

  • The literal /etc/ssh/sshd_config needs to have its underscore escaped with a backslash for the whole path to be displayed in italics . (Edits were too minor to submit them myself) – ThorSummoner Nov 18 '14 at 22:45
  • its the better answer – harshitgupta Oct 27 '15 at 17:21
2

its in your sshd file (not ssh, which you'll also probably find in /etc/ssh)

I believe you want to make sure PasswordAuthentication yes is set and uncommented.

  • 2
    af beat me to it by moments. -annoyingly I can't comment on his yet. You should be able to run /etc/init.d/sshd restart rather than having to reboot, after editing the conf. – BuildTheRobots Dec 30 '09 at 17:40
  • and I typo'd when telling you what directive. sorry :( – BuildTheRobots Dec 30 '09 at 19:53
  • MidnighToker: you should have an "edit" link at the bottom of your answer that you can use to fix the name of the directive (from PubkeyAuthentication to PasswordAuthentication) – James Polley Dec 30 '09 at 20:19
  • thanks. It'll make me more careful in future -lost rep for that. – BuildTheRobots Dec 30 '09 at 20:29
  • 1
    That'd be /etc/init.d/sshd reload on any half-sane distro. – womble Dec 31 '09 at 6:37
0

And in case anyone else runs into this problem, I've received this problem whenever the private key of the user has too open of permissions. In order to get it to work I had to chmod the private key to 400 (which is the permissions level by default when the key is created, I believe. Don't know why this one was different).

I don't know if this is always the case, though. This happened on a Mac.

0

For me, it turned out that during a freak troubleshooting session, the LOCAL ssh_config file was modified. None of these methods worked for me, but changing PasswordAuthentication yes in /etc/ssh/ssh_config of the local machine worked.

Just in case it helps someone out.

-1

This can also be caused by ssh-agent running. ps aux|grep ssh-agent

It can safely be killed.

  • 3
    No, it can't, and no, it can't. – womble Jul 23 '16 at 1:11

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.