解決使用Git遇到的:Enter passphrase for key '/Users/zhangxiaoxue/.ssh/id_rsa'問題


創建SSH Key

ssh-keygen -t rsa -C "youremail@example.com"

在生成SSH Key時,如果不小心設置了passphrase,使用SSH協議克隆遠程倉庫時,在每次git pull和git push時都會提示Enter passphrase for key '/Users/zhangxiaoxue/.ssh/id_rsa',每次都要手動輸入密碼才能繼續操作,可以在命令行輸入sh-keygen -p進行重新設置,直接回車輸入為空,就沒有密碼了。

zhangxiaoxue@MacBook-Pro learn-git % ssh-keygen -p
Enter file in which the key is (/Users/zhangxiaoxue/.ssh/id_rsa): 
Enter old passphrase: 
Key has comment 'sybil3904@163.com'
Enter new passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved with the new passphrase.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM