sshを使用してクライアントからログインするためには、リモートホストでsshdを起動させておく必要があります。以下を/etc/rc.confに追加します。
sshd_enable="YES"
/etc/ssh/sshd_configを変更することで、sshdの設定を変更できます。といっても特に変更点はないのですが、一箇所だけ変更します。
ChallengeResponseAuthentication no
これで、ssh認証鍵を使用する認証以外のssh経由のログインを許可しない設定になります。
変更点を有効にするために、sshd を再起動します。
# /etc/rc.d/sshd restart
上記の設定で、ssh認証鍵を使用する設定にしているので、認証鍵を作成します。ここではDSA公開鍵認証を使用しています。
> ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/user/.ssh/id_dsa): (リターン) Created directory '/home/user/.ssh'. Enter passphrase (empty for no passphrase): (パスフレーズを入力) Enter same passphrase again: (再度パスフレーズを入力) Your identification has been saved in /home/user/.ssh/id_dsa. Your public key has been saved in /home/user/.ssh/id_dsa.pub. The key fingerprint is: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx user@local
/.ssh 以下に作成した認証鍵のうち、id_dsa.pub の内容を接続先の ~/.ssh/authorized_keys2 にコピーします。
作成した認証鍵を接続先の ~/.ssh にコピーした後に、
> cat id_dsa.pub >> authorized_keys
とするのが一番簡単だと思います。