Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

ssh authenticated git access at windows command prompt?

There are many fine instructions about how to work with git under windows using GitBash.

I note that when git is installed, it offers the option of "set up for using git from the windows prompt", which puts git on the windows path.

Is there some way to set this up so that ssh authentication works?

At the moment I get "permission denied (publickey)" when I try to do git commands that access the remote.

(edit) I have set %HOME% to point to my Windows home directory, and there is a .ssh folder in there with id files that work under a gitbash shell.

I appreciate that the answer is likely "no, this is why GitBash exists". But - it would be good to know for sure.

If the answer is "no" it kinda makes you wonder why you would bother putting git on your windows path?

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

ssh access works fine from a regular DOS session.
You only need to define C:UsersYourAccount.ssh and add your id_rsa and id_rsa.pub there.

Launch your git session through git-cmd.bat, which will define %HOME% to your C:UsersYourAccount: that is what will make ssh work.

This should put your msysgit/bin installation in your PATH.

I really recommend not installing through a msi (Microsoft Installer), but through a simple unzip of an archive (portable version "PortableGit-x.y.z-preview201ymmdd.7z")

And the OP GreenAsJade's comment points out the fact that GIT_SSH must point to plink.exe.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...