-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Permission denied (publickey) on cmd but not on git-bash #848
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
Comments
(BTW the title of this ticket ("SSH not available") is really misleading. You would not get that message if SSH was really not available.) That looks as if your You should be able to find out more by adding an alias that calls [alias]
ssh-test = !ssh -v -v -v -v [email protected] in the |
Sorry for the title, if you see something better I will be happy to edit it ! I just tried what you did and both on cmd and git bash the ssh config file was read. However, with git-bash the passphrase was not needed (I have a running ssh agent), while in CMD I had to enter my passphrase. I do not have a |
How about "ls-remote returns: 'fatal: Could not read from remote repository when using SSH'"
The GitWrapper already does something similar. My guess it is some interaction between your environment and how the Git for Windows ecosystem operates. Git-Bash gets to do more setup and therefore has more control over the environment than Cmd does. Is you Git installation on the %PATH% from CMD? What does your %PATH% look like? Do you SSH_ASKPASS or GIT_ASKPASS set? |
The problem is more general than just
Yes (as said in the "setup" part of the OP). The last component of
For git-bash, |
I have some other info. I added
ssh finds the config file, but for some reason doesn't use it. BTW my
I notice ssh is also trying to read |
Please note that you have to have the environment variables set up correctly for SSH agent to be accessible. In Git Bash, it is probably your |
@tlescoat did you manage to figure out where you set up the SSH agent connection in your Bash profile? |
I guess it is some Bash profile issue. Would be nice to know for sure, though. |
I ran into a similar issue (works under git bash, not under windows cmd). With
This then spawns another ssh task, which fails.
This fails, because
From what I can tell, "cmd ssh" and "sh ssh" are in fact two different executables, with slightly different versions. For whatever reason, lfs insists on talking to the latter, and the latter does not work under windows cmd, apparently due to some tty issue or otherwise can't prompt for a password interactively. Unclear to me why it can't talk to |
@drewcrawford in general, it is a good idea to open a new ticket instead of adding a comment to a ticket that has been resolved almost five years ago.
Most likely
There are most likely two very different OpenSSH builds at play: the internal copy shipped with Git for Windows, which is based on the MSYS2 runtime, a POSIX emulation layer. Only MSYS programs linking to the same MSYS2 runtime have access to emulated things (such as The other OpenSSH version is the native one built by the PowerShell-w32 team, and it does not even seem to require a POSIX emulation layer. And it certainly does not have any way to access the other OpenSSH's |
After debugging this further, looks related to #2944 Namely, system32\OpenSSH\git.exe works, communicates with win32 ssh-agent, and is the executable seemingly preferred by top-level
Forcing system32 ssh everywhere seems to be an effective solution
|
I would be surprised if that was the case. I think it is the other way round. |
or closed issue
matching what I'm seeing.
Setup
C:\Program Files\Git\cmd
is added toPATH
...\Git\bin
and...\Git\cmd
:Details
Git from
git-bash
does work perfectly. However git fromCMD
is near unusable since it cannot use ssh, so no remote operations like push, pull, fetch... Example:From Git bash:
From CMD:
Note that these commands were run in the exact same repository.
I expected it to work the same regardless of the shell, as was advertised in the installer. I think it is a bug, but if you consider it a feature, then please clarify it in the installer (by adding a sentence for it, like "Note that git from CMD won't be able to use ssh.")
The text was updated successfully, but these errors were encountered: