N
N
Nikname_non_name2019-10-06 20:06:03
linux
Nikname_non_name, 2019-10-06 20:06:03

Problem with SSH?

Hello!
When I try to connect using ssh key I get an error server refused our key. Although when connecting with a password, everything goes fine. Public keys are stored on the path /home/user_folder/.ssh in the authorized_keys file, in the sshd_config file such parameters are

PubkeyAuthentication yes

AuthorizedKeysFile      %h/.ssh/authorized_keys     /etc/ssh/authorized_keys
.
What could be the problem and how to solve it?! Tell me please!!!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vitaly Karasik, 2019-10-06
@vitaly_il1

Look in the logs (/var/log/secure | /var/log/auth),
you can also run "ssh -v" on the client.

R
Radjah, 2019-10-06
@Radjah

chmod 400 ~/.ssh/authorized_keys
If the public key is correct, and in the logs the server swears at too loose rights to the file.

F
fara_ib, 2019-10-07
@fara_ib

And how did you put the keys on the server? There is a glitch with how the key itself looks in the authorized_keys file. It needs to be edited a little or something ... Remove unnecessary information. 5d9b54e330daa420912441.jpegAnd after ssh-rsa, you can remove the line feed ... Preferably, all this should be on one line. I don't know why that is, but there is such a thing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question