Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
465 views
in Technique[技术] by (71.8m points)

windows - MSysGit and ssh config. missing

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

Okay! ssh config reading well.

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

Nooo. ssh config file is missing...

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

What is probably missing is the user environment variable HOME.

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)

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...