threads / bug / 47694

git credential-osxkeychain bug/feature?

Subject: git credential-osxkeychain bug/feature?

## tl;dr

2 messages between Jan 25, 2018 and Jan 26, 2018.

replies: 1people: 2as markdown or json

Robert Leach· Jan 25, 2018, 17:16 UTC · lore
Hi,
I wanted to submit an issue regarding the credential-osxkeychain interface functionality.  I don't know whether it's a bug or a feature request.  Maybe it's even impossible to address? - I don't know, but here's my issue.  Let me know if fixing/implementing this is a bad idea or if it's an issue relating to something wrong on my system and not an issue with git itself.
I have a git repo in a dropbox directory (not sure if that's relevant - just giving full disclosure).  I have set up git to not ask me for my password by using the credential-osxkeychain feature, and it works great... unless I'm connected via ssh to the machine that has a copy of my Dropbox on it.  Various git commands interrogate me for my login instead of using the credentials stored in the KA database on that remote machine, e.g.:

git remote show origin Username for 'https://github.com': ^C

When I'm sitting at that machine, I do not get asked for my login credentials.
It's a minor issue, and kind of silly TBH.  I can always just work on my repo locally and synch, but if I'm working on a project that processes a large dataset, it's faster to edit the project on the machine with the data I'm testing it with.  I could VNC in or just synch after each change, which works around the issue, but it's nicer to just do everything on one ssh terminal session.
But perhaps access to KA from a remote ssh session is restricted for security reasons?  I'm just curious I suppose.  Should/can this work?

Thanks, Rob

Jeff King· Jan 26, 2018, 00:51 UTC · re: Robert Leach · lore

Re: git credential-osxkeychain bug/feature?

On Thu, Jan 25, 2018 at 12:16:33PM -0500, Robert Leach wrote:
> But perhaps access to KA from a remote ssh session is restricted for
> security reasons?  I'm just curious I suppose.  Should/can this work?

It's definitely not a restriction from the osxkeychain credential helper. I believe that MacOS only unlocks the keychain for console logins by default.

Googling around I turned up this[1]:
  security unlock-keychain -p <YourPassword> ~/Library/Keychains/login.keychain

but I don't even have a mac these days to see if that still works. And according to [2] you may have to fiddle with auto-confirmation. Good luck. :)

-Peff
[1] https://superuser.com/questions/270095/when-i-ssh-into-os-x-i-dont-have-my-keychain-when-i-use-terminal-i-do
[2] https://apple.stackexchange.com/questions/178139/how-can-i-access-the-keychain-remotely-from-the-command-line

← back to recent threads