$ ls -al /c/Users/daya/.ssh/
total 28
drwxr-xr-x 1 daya 197121 0 十一 23 14:48 ./
drwxr-xr-x 1 daya 197121 0 十一 23 14:52 ../
-rw-r--r-- 1 daya 197121 3247 十一 23 14:48 id_rsa #新建的私鑰
-rw-r--r-- 1 daya 197121 742 十一 23 14:48 id_rsa.pub #新建的公鑰
-rw-r--r-- 1 daya 197121 628 十一 23 14:42 known_hosts
2撩炊、生成SHH Key并添加到ssh-agent里面
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" # 使用一個郵箱作為一個標(biāo)記思犁,生成新的ssh key
Generating public/private rsa key pair.
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter] #這里是保存路徑,直接回車就行
Enter passphrase (empty for no passphrase): [Type a passphrase] #這里是設(shè)置一個口令栈戳,便于管理這些密匙,可以為空
Enter same passphrase again: [Type passphrase again]
$ ssh-add ~/.ssh/id_rsa #添加您的私鑰到ssh-agent