MSysGit和ssh配置.失踪

Ale*_*der 10 windows git ssh msysgit

1)运行Git Bash(C:\ Program Files(x86)\ Git\bin\sh.exe --login)

$ ssh -v git@github.com
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.
...
Run Code Online (Sandbox Code Playgroud)

好的!ssh配置好读.

2)从cmd.exe运行

C:\Users\Alexander Fedorov>ssh.exe -v git@github.com
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).
Run Code Online (Sandbox Code Playgroud)

拿去.ssh配置文件丢失了......

如何...如何从ssh.exe读取配置?

Von*_*onC 10

可能缺少的是用户环境变量HOME.

如果从git-cmd.batmsysgit打包的脚本启动DOS会话,则应该定义它,您应该看到%HOME%\.ssh\id_rsa(.pub)

但是从任何其他DOS窗口,HOME默认情况下都没有定义(HOMEPATH或者USERPROFILE是).
另请参阅" 修复msysGit Portable $ HOME位置 "作为插图(但您不应该使用最新版本的msysgit及其git-cmd.bat脚本进行解决方法 )