查看SSH Key
$ cd .ssh
進入該文件后,查看下該文件夾下的文件:
$ ls
圖1
如上圖:
- id_rsa:私鑰
- id_rsa.pub:公鑰
生成SSH Key
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
該命令會生成新的SSH Key婚肆,輸入GitHub上的郵箱即可
Enter a file in which to save the key (/Users/you/.ssh/id_rsa):
這里,直接按回車钉寝,默認存儲在.ssh文件里
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
關(guān)于密碼的設(shè)置和確認密碼,不需要直接按回車
Mac環(huán)境下彤叉,顯示隱藏文件/不顯示隱藏文件
- 顯示
$ defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder
- 不顯示
$ defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder