解决使用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