1

I set up a linux server and created a new user. When trying to connect to the server via user@ip i get the message Permission denied. Please try again. after entering the password.

When logging in via su - user from my user this works without problems, so the password schould be correct.

I checked if the user is locked which is not the case.

I also checked the sshd_config: PasswordAuthentication yes.

I also tried adding the user to AllowedUsers: AllowUsers my_user user

All of this didn't work.

1
  • @KamilMaciorowski Ah, thanks, that was the solution. Commented May 8, 2019 at 12:09

2 Answers 2

2

If AllowUsers … was there before and you only added user to the line, you should reload sshd. Without reloading the old config still applies, so the old AllowUsers … line restricts you from logging in as user.

With systemd you reload the configuration of SSH server like this:

systemctl reload ssh.service

(restarting the server will also work).

0

A had the similar issue.

Heres what I found out and solved my issue:

I had edit the /etc/ssh/sshd_config file.

I had to uncomment:

"#PermitRootLogin yes"

and

"#PublicAuthentication yes"

and had to comment:

"#PasswordAuthentication yes"

Then had to erase the old ssh keys:

rm -rf /home/user/.ssh

Then did:

ssh [email protected]

This solved my issue, I created a new ssh fingerprint key, then was asked to enter the login password of the host remote machine.

You must log in to answer this question.

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