SSHサーバーは、ユーザーが(サーバーに)ログインしている場合にのみキーを受け入れます。

SSHサーバーは、ユーザーが(サーバーに)ログインしている場合にのみキーを受け入れます。

ローカルアカウントでは、(id_rsa)キーを使用して自分のサーバーに接続できます。サーバー上ログインしました。

サーバーを再起動し、ログインマネージャにそのままにしてから接続しようとすると、SSHが返されます。

Permission denied (publickey)

/.ssh キーと .ssh/authorized キーに対する権限は、サーバーとクライアントでそれぞれ 700 と 600 です。

顧客:

henry@MSI-LT17:~ > ls -la ~ | grep ".ssh"
drwx------   3 henry henry  4096 Jan 23 16:31 .ssh
henry@MSI-LT17:~ > ls -la ~/.ssh | grep "authorized_keys"
-rw-------  1 henry henry  228 Jan 23 16:31 authorized_keys

仕える人:

henry@henry-dt:~ > ls -la ~ | grep ".ssh"                                                                                                                                               drwx------  2 henry henry    4096 Jan 19 18:24 .ssh
henry@henry-dt:~ > ls -la ~/.ssh | grep "authorized_keys"
-rw-------  1 henry henry  397 Jan 19 18:56 authorized_keys

ログイン試行の-vvv出力は次のとおりです。

debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/henry/.ssh/id_rsa
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug3: sign_and_send_pubkey: RSA 0d:a8:df:84:1b:25:6e:7f:04:ad:98:87:bd:0b:7d:88
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/henry/.ssh/id_dsa
debug3: no such identity: /home/henry/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/henry/.ssh/id_ecdsa
debug3: no such identity: /home/henry/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/henry/.ssh/id_ed25519
debug3: no such identity: /home/henry/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).

debug1: key_parse_private2: missing begin markerこれと関係があると思います...

ベストアンサー1

答えは次のとおりです。ホームフォルダが暗号化されました...

https://help.ubuntu.com/community/SSH/OpenSSH/Keys#トラブルシューティング

おすすめ記事