[英]public key denied in new terminal
I generated a ssh key and set it up on bitbucket and all was good but when I restarted my computer the key was now getting permission denied.我生成了一个 ssh 密钥并将其设置在 bitbucket 上,一切都很好,但是当我重新启动计算机时,密钥现在被拒绝许可。 I remade it and it failed again when I used a new terminal window.
我重做了它,但当我使用新的终端 window 时它又失败了。 I'm on windows if that helps.
如果有帮助,我在 windows 上。
This is normally happens based on what OS you're using and can be for a couple of reasons.这通常取决于您使用的操作系统,并且可能有几个原因。
The easiest fix is to add the following lines to your ~/.profile
, ~/.bash_profile
or ~/.zshrc
.最简单的解决方法是将以下行添加到您的
~/.profile
、 ~/.bash_profile
或~/.zshrc
中。
eval $(ssh-agent) # create a agent for the shell
ssh-add ~/.ssh/id_rsa # this is one of the default file names, changes as required
Windows also support a similar way for Git Bash. Windows 也支持 Git Bash 的类似方式。
This should load your key to the shell at each lunch or tab.这应该在每个午餐或标签上加载您的 shell 的密钥。
Ps: If your private key has a password, it will prompt for you to type the password every time this runs.
ps:如果你的私钥有密码,每次运行都会提示你输入密码。
This is what it would look like when you launch Git Bash这就是您启动 Git Bash 时的样子
Agent pid 16516
Identity added: /c/Users/Praveen/.ssh/id_rsa (/c/Users/Praveen/.ssh/id_rsa)
Praveen@DESKTOP MINGW64 ~/Desktop
$
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.