前提・実現したいこと
PiServer(サーバ)を用いてネットワークブートをしたRaspberryPi(クライアント)があり、サーバとクライアント間を公開鍵認証によってSSH接続をしたいと考えています。
パスワードによるSSH接続は出来ているのですが、公開鍵認証によるSSH接続がうまく行えていません。
/var/log/auth.logを見る限り、クライアント側が公開鍵を見に行く際にpermission deniedとなっているようです。
しかし~/.sshと~/.ssh/authorized_keysのパーミッションはそれぞれ「drwx------(700)」、「-rw-------(600)」となっており問題ないと思います。
他に設定したり修正したりする必要のある部分はあるのでしょうか?
各ファイルのパーミッション、クライアント側のログ
LED@raspberrypi:~ $ ls -la .ssh total 24 drwx------ 1 LED LED 4096 Jul 29 15:16 . drwxr-xr-x 1 LED LED 4096 Jul 11 14:41 .. -rw------- 1 LED LED 381 Jul 29 15:19 authorized_keys -rw------- 1 LED LED 1675 Jul 11 14:57 id_rsa -rw------- 1 LED LED 381 Jul 29 15:16 id_rsa.pub -rw-r--r-- 1 LED users 222 Jul 11 14:41 known_hosts
/var/log/auth.log
Jul 29 16:01:47 raspberrypi sshd[447]: debug1: Forked child 707. Jul 29 16:01:47 raspberrypi sshd[707]: debug1: Set /proc/self/oom_score_adj to 0 Jul 29 16:01:47 raspberrypi sshd[707]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8 Jul 29 16:01:47 raspberrypi sshd[707]: debug1: inetd sockets after dupping: 3, 3 Jul 29 16:01:47 raspberrypi sshd[707]: Connection from 192.168.101.253 port 39312 on 192.168.101.159 port 22 Jul 29 16:01:47 raspberrypi sshd[707]: debug1: Client protocol version 2.0; client software version OpenSSH_7.4p1 Debian-10+deb9u6 Jul 29 16:01:47 raspberrypi sshd[707]: debug1: match: OpenSSH_7.4p1 Debian-10+deb9u6 pat OpenSSH* compat 0x04000000 Jul 29 16:01:47 raspberrypi sshd[707]: debug1: Local version string SSH-2.0-OpenSSH_7.4p1 Raspbian-10+deb9u6 Jul 29 16:01:47 raspberrypi sshd[707]: debug1: Enabling compatibility mode for protocol 2.0 Jul 29 16:01:47 raspberrypi sshd[707]: debug1: permanently_set_uid: 107/65534 [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: SSH2_MSG_KEXINIT sent [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: SSH2_MSG_KEXINIT received [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: kex: algorithm: curve25519-sha256 [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: rekey after 134217728 blocks [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: SSH2_MSG_NEWKEYS sent [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: expecting SSH2_MSG_NEWKEYS [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: SSH2_MSG_NEWKEYS received [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: rekey after 134217728 blocks [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: KEX done [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: userauth-request for user LED service ssh-connection method none [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: attempt 0 failures 0 [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: PAM: initializing for "LED" Jul 29 16:01:47 raspberrypi sshd[707]: debug1: PAM: setting PAM_RHOST to "192.168.101.253" Jul 29 16:01:47 raspberrypi sshd[707]: debug1: PAM: setting PAM_TTY to "ssh" Jul 29 16:01:47 raspberrypi sshd[707]: debug1: userauth-request for user LED service ssh-connection method publickey [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: attempt 1 failures 0 [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: userauth_pubkey: test whether pkalg/pkblob are acceptable for RSA SHA256:V8iqoIwrpARwkx2WpM0BBvxnJC/52+pRQU6Hkyxq62s [preauth] Jul 29 16:01:47 raspberrypi sshd[707]: debug1: temporarily_use_uid: 10001/100 (e=0/0) Jul 29 16:01:47 raspberrypi sshd[707]: debug1: trying public key file /home/LED/.ssh/authorized_keys Jul 29 16:01:47 raspberrypi sshd[707]: debug1: Could not open authorized keys '/home/LED/.ssh/authorized_keys': Permission denied Jul 29 16:01:47 raspberrypi sshd[707]: debug1: restore_uid: 0/0 Jul 29 16:01:47 raspberrypi sshd[707]: debug1: temporarily_use_uid: 10001/100 (e=0/0) Jul 29 16:01:47 raspberrypi sshd[707]: debug1: trying public key file /home/LED/.ssh/authorized_keys2 Jul 29 16:01:47 raspberrypi sshd[707]: debug1: Could not open authorized keys '/home/LED/.ssh/authorized_keys2': Permission denied Jul 29 16:01:47 raspberrypi sshd[707]: debug1: restore_uid: 0/0 Jul 29 16:01:47 raspberrypi sshd[707]: Failed publickey for LED from 192.168.101.253 port 39312 ssh2: RSA SHA256:V8iqoIwrpARwkx2WpM0BBvxnJC/52+pRQU6Hkyxq62s
回答1件
あなたの回答
tips
プレビュー