簡介:ssh-keygen使用時出現以下問題時,使用以管理員身份運行的“命令提示符”來生成公鑰,即可解決:
C:\Users\admin>
ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (//.ssh/id_rsa):
Could not create directory '//.ssh': Read-only file system
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Saving key "//.ssh/id_rsa" failed: No such file or directory
原因:主要是因爲其中有句描述:“Could not create directory '//.ssh': Read-only file system”,表明改文件是隻讀的,即沒有寫的權限。
解決辦法: 以管理員身份運行“命令提示符,之後重新使用“命令提示符”來生成ssh-key
1.win10:
2.win7:
單擊“開始”按鈕,再選擇“所有程序”,選擇“附件”,再選擇“命令提示符”命令,從彈出的菜單中選擇“以管理員身份運行”命令。