MSysGit 和 ssh 配置.失踪 [英] MSysGit and ssh config. missing

查看:18
本文介绍了MSysGit 和 ssh 配置.失踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

1) Run Git Bash (C:Program Files (x86)Gitinsh.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 配置阅读良好.

Okay! ssh config reading well.

2) 从 cmd.exe 运行

2) Run from cmd.exe

C:UsersAlexander 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 配置文件丢失...

Nooo. ssh config file is missing...

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

How... how read config from ssh.exe?

推荐答案

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

What is probably missing is the user environment variable HOME.

如果你从 msysgit 打包的 git-cmd.bat 脚本启动你的 DOS 会话,它应该被定义,你应该看到 %HOME%.sshid_rsa(.pub)

If you launch your DOS session from the git-cmd.bat script packaged with msysgit, it should be defined, and you should see %HOME%.sshid_rsa(.pub)

但是在任何其他 DOS 窗口中,HOME 不是默认定义的(HOMEPATHUSERPROFILE 是).
另请参阅修复 msysGit Portable $HOME 位置"作为说明(但是您不应该使用最新版本的 msysgit 及其 git-cmd.bat 脚本)

But from any other DOS windows, HOME isn't defined by default (HOMEPATH or USERPROFILE are).
See also "Fix msysGit Portable $HOME location" as an illustration (but you shouldn't need that workaround with recent versions of msysgit and its git-cmd.bat script)

这篇关于MSysGit 和 ssh 配置.失踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆