PC-UNIXに関する記事など
FreeBSDの場合だとsecurity/ssh-copy-id のportsがあります。
# portinstall ssh-copy-id
$ cd $ ssh-keygen -t rsa
$ ssh-copy-id -i .ssh/id_rsa.pub user@remote_host
上記コマンドで公開鍵をリモートホストのauthorized_keysに追加します
ssh-copy-id コマンドを使わないで愚直にやるなら以下のようにしても一発で可能です。
$ cat ./.ssh/id_rsa.pub | ssh user@remote_host "cat >> ./.ssh/authorized_keys"
公開鍵認証にするにはsshdサーバのパスワード認証を止める設定が必要になります。
PasswordAuthentication no UsePAM no
トラックバックURL: http://www.omakase.org/mt/mt-tb.cgi/108
コメントする