为什么哦,为什么我从github克隆时被要求通过?
git clone [email protected]:test/testchef.git Cloning into 'chef'... The authenticity of host 'github.com (xxx.xxx.xxx.xxx)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,xxx.xxx.xxx.xxx' (RSA) to the list of known hosts. Enter passphrase for key '/root/.ssh/git_id_rsa.pub':
这里是我的SSHconfiguration文件:
Host *github.com IdentityFile ~/.ssh/git_id_rsa.pub
如果我从结构运行..我得到没有错误,但我得到提示通行证,如果我尝试克隆def bootstrap():put('ssh_config','/ root / .ssh / config')put('git_id_rsa.pub ','/ root / .ssh / git_id_rsa.pub')put('git_id_rsa','/ root / .ssh / git_id_rsa')run(“”“chmod 600 /root/.ssh/git_id_rsa*”“”)run (“”“eval ssh-agent -s ; ssh-add /root/.ssh/git_id_rsa”“”)
面料的相关产量:
[107.170.196.221] out: Agent pid 2285 [107.170.196.221] out: Identity added: /root/.ssh/git_id_rsa (/root/.ssh/git_id_rsa) [107.170.196.221] out:
我login到服务器并从命令行运行eval ssh-agent -s ; ssh-add /root/.ssh/git_id_rsa git clone [email protected]:test / testchef.git
..great ..我可以克隆而不要求通过。 为什么它没有从面料工作?
由于身份文件是私钥,而不是公钥:
Host *github.com IdentityFile ~/.ssh/git_id_rsa # Without the .pub