Ошибка подключения по ключу через SSH


ssh 

На клиенте

debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /tmp/rsa.key RSA SHA256:V6BNCNQZRPAelcgzm2JcJLIooN9AMAgolX4QAMPjYs8 explicit
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
user@192.168.0.1: Permission denied (publickey).

На сервере

Oct 24 01:29:59 server sshd[2208]: Authentication refused: bad ownership or modes for directory /home/user
Oct 24 01:29:59 server sshd[2208]: Connection closed by authenticating user master 192.168.0.7 port 32836 [preauth]
Ответы

Проверить на сервере права на домашнюю директорию и .ssh, а также файл .ssh/authorized_keys

chmod g-w /home/user
chmod 0700 /home/user/.ssh
chmod 0600 /home/user/.ssh/authorized_keys