git key_load_public:即使文件存在,也没有这样的文件或目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42906366/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
key_load_public: No such file or directory even though file exists
提问by octavian
I am trying to connect to a Bitbucket server. My machine has Windows, with Git Bash.
我正在尝试连接到 Bitbucket 服务器。我的机器有 Windows,有 Git Bash。
On /h/.ssh/id_rsa
and /h/.ssh/id_rsa.pub
, I have a key for the repository.
Also in /h/.ssh/config
, I have the configuration for the repository:
在/h/.ssh/id_rsa
和 上/h/.ssh/id_rsa.pub
,我有一个存储库的密钥。同样在/h/.ssh/config
,我有存储库的配置:
Host my-repo-name
User my-user
Hostname my-repo.com
Port 7999
IdentityFile id_rsa
When I'm trying to connect to the repository like this:
当我尝试像这样连接到存储库时:
ssh -Tv [email protected]
I'm getting this message:
我收到这条消息:
OpenSSH_7.1p2, OpenSSL 1.0.2h 3 May 2016
debug1: Reading configuration data /h//.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to my-repo.com port 22.
debug1: Connection established.
debug1: identity file /h/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
There are two things I don't understand here:
这里有两件事我不明白:
1.If I have /h/.ssh/id_rsa
and /h/.ssh/id_rsa.pub
, why am I getting key_load_public: No such file or directory
?
1.如果我有/h/.ssh/id_rsa
和 /h/.ssh/id_rsa.pub
,为什么我会得到key_load_public: No such file or directory
?
2.If in the configuration I specify Port 7999
, why does it connect to port 22 Connecting to my-repo.com port 22
?
2.如果在我指定的配置中Port 7999
,为什么它连接到端口22 Connecting to my-repo.com port 22
?
采纳答案by Jakuje
- If I have /h/.ssh/id_rsa and /h/.ssh/id_rsa.pub, why am I getting key_load_public: No such file or directory?
- 如果我有 /h/.ssh/id_rsa 和 /h/.ssh/id_rsa.pub,为什么我会得到 key_load_public: No such file or directory?
It is just bogus warning. More information can be found if you run with more verbose log level -vvv
.
这只是虚假警告。如果您使用更详细的日志级别运行,可以找到更多信息-vvv
。
- If in the configuration I specify Port 7999, why does it connect to port 22 Connecting to my-repo.com port 22?
- 如果在配置中我指定了端口 7999,为什么它连接到端口 22 连接到 my-repo.com 端口 22?
Because the Port 7999
is sepcified only for host my-repo-name
, not for my-repo.com
where you are trying to connect. It would get used if you would run
因为Port 7999
仅适用于 host my-repo-name
,而不适用my-repo.com
于您尝试连接的位置。如果你跑,它会被使用
ssh -Tv git@my-repo-name