Skip to content

解决git clone 提示需要输入密码

在centos中安装了相应的git maven 等。想要把项目导入到服务器中进行打包处理.

在git clone 的时候就出现提示输入密码的问题:

gent admitted failure to sign using the key.
[email protected]’s password:
Permission denied, please try again.
[email protected]’s password:
Permission denied, please try again.
[email protected]’s password:
Permission denied (publickey,password,keyboard-interactive).
fatal: Could not read from remote repository.

通过一系列的搜索

最终解决方法如下:

[root@w01 work]#eval “$(ssh-agent -s)”
Agent pid 6899
[root@w01 work]#ssh-add ~/.ssh/server50
Enter passphrase for /root/.ssh/server50:
Identity added: /root/.ssh/server50 (/root/.ssh/server50)

步骤:
1.执行eval “$(ssh-agent -s)”
2.ssh-add ~/.ssh/server50
注意:如果你没有定义私钥文件名称,默认为:id_rsa 则命令可以变为:ssh-add
如果你定义了私钥文件名称,比如我这里是 server50. 则命令为:ssh-add ~/.ssh/server50

发表评论

电子邮件地址不会被公开。 必填项已用*标注