Macで公開鍵を作成する方法
1.サーバ側
#mkdir ~/.ssh
#chmod 700 ~/.ssh
2.mac側
公開鍵を作成
#ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/cftuser/.ssh/id_rsa):
Overwrite (y/n)?
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/cftuser/.ssh/id_rsa.
Your public key has been saved in /Users/cftuser/.ssh/id_rsa.pub.
The key fingerprint is:
The key’s randomart image is:
(
3.権限付与
#chmod 600 ~/.ssh/id_rsa.pub
4.公開鍵をサーバへ転送
#scp ~/.ssh/id_rsa.pub testuser@172.17.20.101:~/.ssh/authorized_keys