【问题标题】:MSysGit and ssh config. missingMSysGit 和 ssh 配置。失踪
【发布时间】:2012-04-24 17:34:07
【问题描述】:

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.
...

好的! 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).

不。 ssh 配置文件丢失...

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

【问题讨论】:

    标签: windows git ssh msysgit


    【解决方案1】:

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

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

    但在任何其他 DOS 窗口中,HOME 未默认定义(HOMEPATH 或 USERPROFILE 是)。
    另请参阅“Fix msysGit Portable $HOME location”作为说明(但对于最新版本的 msysgit 及其git-cmd.bat 脚本,您不需要这种解决方法)

    【讨论】:

    • 好的!谢谢。添加环境变量 HOME
    猜你喜欢
    • 1970-01-01
    • 2012-09-10
    • 1970-01-01
    • 2011-06-11
    • 2022-10-05
    • 2022-09-30
    • 1970-01-01
    • 2016-11-01
    • 2016-02-23
    相关资源
    最近更新 更多