忘れていた部分があったから
SSHの設定
# ssh設定
sed -i -e 's/#Port 22/Port 10122/' /etc/ssh/sshd_config
sed -i -e 's/#PermitRootLogin no/PermitRootLogin no/' /etc/ssh/sshd_config
sed -i -e 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
sed -i -e 's/#PermitEmptyPasswords no/PermitEmptyPasswords no/' /etc/ssh/sshd_config
sed -i 's/^PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
echo "AllowUsers admin" >> /etc/ssh/sshd_config
/sbin/service sshd restart
鍵の生成
chmod 0700 ~/.ssh/
cd ~/.ssh/
ssh-keygen -t rsa
mv id_rsa.pub authorized_keys
chmod 0600 authorized_keys
秘密鍵の取得
cat ~/.ssh/id_rsa # 中身をコピる
鍵設定(mac)
vi ~/.ssh/key # コピったものを貼り付ける
chmod 0700 ~/.ssh/
chmod 0600 ~/.ssh/key
ログイン
ssh user@hostname -p port -i ~/.ssh/key
パスワード入力いらないのは楽だわ(´ω`)