2012-04-12 82 views
10

1)運行git擊(C:\ Program Files文件(x86)的\的Git \ BIN \ sh.exe --login)MSysGit和ssh配置。缺少

$ ssh -v [email protected] 
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007 
debug1: Reading configuration data /c/Users/Alexander Fedorov/.ssh/config 
debug1: Applying options for github.com 
debug1: Connecting to github.com [207.97.227.239] port 22. 
debug1: Connection established. 
... 
Hi xpoft! You've successfully authenticated, but GitHub does not provide shell access. 
... 

好吧! ssh配置很好。

2)從cmd.exe的

C:\Users\Alexander Fedorov>ssh.exe -v [email protected] 
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007 
debug1: Connecting to github.com [207.97.227.239] port 22. 
... 
debug1: No more authentication methods to try. 
Permission denied (publickey). 

拿去運行。 ssh配置文件丟失...

如何...如何從ssh.exe讀配置?

回答

10

可能丟失的是用戶環境變量HOME

如果從git-cmd.bat腳本msysgit打包推出你的DOS程序,它應該被定義,你應該看到%HOME%\.ssh\id_rsa(.pub)

但從其他任何DOS窗口,HOME不是默認(HOMEPATHUSERPROFILE定義是)。
另請參閱「Fix msysGit Portable $HOME location」作爲示例(但不應使用最近版本的msysgit及其git-cmd.bat腳本的解決方法)

+0

Ok!謝謝。添加環境變量HOME – Alexander 2012-04-13 05:56:11