S
S
sflyer2019-03-18 12:55:51
SSH
sflyer, 2019-03-18 12:55:51

Can't connect to ssh via key, what's wrong?

Ubuntu 16.04, trying to set up an ssh key connection. Before that, I configured it on 18.04 without any problems with the same parameters (it works). I saved the keys in /home/user/.ssh/authorized_keys. When connecting in the server logs, the error is:
Authentication refused: bad ownership or modes for directory /home/user
Permissions on the folder and file:
600 /home/user/.ssh/authorized_keys
700 /home/user/.ssh/
755 /home/user /
Owner everywhere user:user
What did I change in the sshd_config config:
PubkeyAuthentication yes
PasswordAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NOONE, 2019-03-18
@sflyer

Check who is the owner of /home/user. Apparently you are connecting as a different user. You need to connect under the user for whom you made the key

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question