Linux
以前にssh-keysについて聞いたことがない場合は、このようなものを生成する必要があります
$ ssh-keygen -t dsa
これにより、ディレクトリが作成され~/.ssh/、キーファイルが保存されます
$ ls -l .ssh/
-rw------- 1 gnibbler gnibbler 668 Aug 22 2004 .ssh/id_dsa
-rw------- 1 gnibbler gnibbler 603 Aug 22 2004 .ssh/id_dsa.pub
id_dsa.pubRPi にコピーする必要があります。ヘルパースクリプトを使用してこれを行う非常に簡単な方法があります。
$ ssh-copy-id -i ~/.ssh/id_dsa.pub pi@raspberrypi.local
pi最後にもう一度ユーザーパスワードを入力する必要があります
次回ログインするとき、パスワードの入力は求められません
$ ssh pi@raspberrypi.local
Linux raspberrypi 3.1.9+ #174 PREEMPT Sun Jul 22 19:04:28 BST 2012 armv6l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Type 'startx' to launch a graphical session
パスワードログインを無効にするにはどうすればよいですか?
キーベースのログインを設定したら、パスワードを使用してログインする必要はもうありません。無効にすることができます。これははるかに安全です。
まず、あなたのラズベリーパイにログインして、オープン/etc/ssh/sshd_configなどroot。たとえば、実行しsudo vim /etc/ssh/sshd_configます。
PasswordAuthentication; を含む行を見つけます。それはおそらく読む#PasswordAuthentication yes。
この行を変更して読みます
パスワード認証
あなたのラズベリーパイを再起動、またはちょうどsshd。
Arch Linux
sshdArchで再起動するには、を実行しsudo rc.d restart sshdます。
Debian / Raspbian
sshdDebianベースのディストリビューションで再起動するには、を実行しsudo /etc/init.d/sshd restartます。