-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git can't work as network service with OpenSSH #569
Comments
Your report misses an error message you get. Two more things:
|
The error I get is: (the trace doesn't give any extra info) Permission denied (publickey). There was no change after adding the /c argument to PsExec |
Please try |
@Radrik5 good point. This has been fixed recently. Which points out a serious short-coming of this bug report: it is pretty sloppy, e.g. missing out the exact architecture and version of Git for Windows used. Here is an article that should help address those short-comings: https://github.com/git-for-windows/git/wiki/Issue-reporting-guidelines |
Are you using DSA keys? Have a look at #375 and/or #421.
Can you paste the trace info anyways? It might contain details, that don't seem usefull to you, but are usefull to us. The |
@rimrul, the OP stated that
so I beleive the DSA key should not be the reason. I tend to suspect some crucial difference in the environment between normal users and that service account which makes OpenSSH fail to locate the key (or something like this). I think @Radrik5's idea is a spot-on: an explicit call to |
Right. I missed that. It might still be, if OP accidentially copied the wrong key or tested against a different host or something, but it's less likely.
That should deffinitly help. I was trying to provide additional assistance. |
@rimrul, oh, I definitely did not intend to bash your insight.
The more ideas are thrown at a problem, the better!
|
Some clarifications and answers:
Error establishing communication with PsExec service on My-PC: |
Are you positive If yes, there might be some problem with |
In the first post you wrote
In your clarifications and answers post you wrote
The issue is a missing |
The path |
Yes ssh.exe exists, it executed when I run without PsExec |
Is it possible to run a shell (say, If yes, the next step will be to attempt running that If my initial hypothesis is correct, the next logical step would be |
The error I get is:
I wish the bug report was more thorough so I would not be stuck on the preliminaries such as reproducing the issue. |
psexec.exe -i -u "nt authority\network service" "C:\Program Files\Git\cmd\git.exe" ls-remote "ssh://[email protected]/whatever.git" worked for me with GfW 2.6.1 on WinXP SP3 32-bit. Git started, and was able to use On the other hand, IIUC much has been changed since XP in regard to running services. |
Just tried to run
on a nearby Windows 7 64-bit and it worked OK if I run the command in a shell started with elevated privileges (otherwise it fails with "Permission denied" error). The environment of the shell spawned looks quite okay to me (some inessential bits elided):
So I'm inclined to think this issue is somehow specific to GfW. |
On my Windows 7, 64-bit VM:
I.e. no dice. Maybe you need to be domain joined or some such. If so, that is information that really would have helped me start the bug hunt already. |
Maybe you need to be domain joined or some such. If so, that is
information that really would have helped me start the bug hunt
already.
Yeah, the machine I tested on is joined into a Windows domain and the
currently logged in user was actually a domain admin (I still had to
ask the user to get me an elevanted shell for the invocation to
succeed).
Have you run your example from an elevated shell as well?
|
I have not a single setup available to me where I am domain admin. I think that explains that. I wish the original report would have been substantially clearer on that detail, it would have saved me something like 1h to stab around and not being a single step closer to reproducing, let alone fixing. I guess I outspent my time quota on this one for a month or so.
Yes. |
I'll see if I would be able to reproduce this in a domain-joined machine |
Just tried to run "C:\Program Files\Git\bin\git.exe" of 2.6.4 on a Win7 64-bit machine joined to a domain using an elevated shell running under a domain admin account -- worked for me. The only weird thing is
At the same time the environment of the GfW has been installed for the first time on this box. I ticked the "Run Git commands in the shell" flag (I always do), selected to use All-in-all, if the message @davekran has in their second round of tests really was
the explanation might indeed lie in that weird So, @davekran, could you start with running
from an elevated whell and see whether ssh will issue warning similar to these in my test run? |
@kostix are you sure ssh has correct |
@Radrik5, the environment I showed was from an instance of In my comment about running |
@kostix I would love to have access to your box again, to investigate that incorrect |
Let's just close this ticket before it is so stale that it starts to smell. |
Hi,
I'm trying to run Git.exe as a network service account when connecting to a private repository with
OpenSSH.
This issue seems to be a regression since I could do the above in Git for windows version 1.9.5
In order to reproduce you can download PsExec utility from the following official Microsoft link:
https://technet.microsoft.com/en-us/sysinternals/psexec.aspx
I created a ".ssh" directory and keys inside network service account home folder "%systemroot%\ServiceProfiles\NetworkService"
The command I run looks like:
psexec.exe -i -u "nt authority\network service" "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote "[email protected]/username/repo"
If I run the above git command as a normal user account, everything works just fine.
I had a search for similar issues in github and found a similar one which had a fix for local system account, please see: #435
Indeed, when I run my command as a local system and ".ssh" directory under local system home folder at "C:\Windows\System32\Config\systemprofile" it works fine with a command like:
psexec.exe -s "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote "[email protected]/username/repo"
This is a critical issue for me since my application runs as network service and executes git as
external process, can you please advise?
Thanks
Dave
The text was updated successfully, but these errors were encountered: