Posh-git: Spin off SSH Agent module?

Created on 30 Dec 2016  路  27Comments  路  Source: dahlbyk/posh-git

As I alluded to in https://github.com/dahlbyk/posh-git/issues/328#issuecomment-269794084, a nontrivial number of issues and open PRs here are dedicated to managing ssh-agent and Pageant.

Since that problem has nothing to do with Git other than Git for Windows being a common distribution path for MSYS, I'd like to spin the SSH Agent bits off into a separate module. Is anyone interested in taking that on?

cc people who have tried to contribute SSH fixes: @theaquamarine (#133) @paulmarsy (#162) @c-mu (#195) @hjoelr (#297) @StefanScherer (#238) @Ventajou (#148) @nitin88 (#295)

Area-SSH Discussion

All 27 comments

Also cc @pcx (#155) @GrahamTheCoder (#211) @kayukin (#316)

@dahlbyk I guess you wanted to cc: @pxc :)

@dahlbyk I guess you wanted to cc: @pxc :)

I suppose I did. You're welcome to help, too. 馃槈

@dahlbyk do you want to host this? If so, what would we call it? posh-git-ssh? There is already a posh-ssh on the PowerShell Gallery but it doesn't seem to deal with the agent or keys.

Also, will the upcoming Win32-OpenSSH implementation impact this?

@dahlbyk do you want to host this? If so, what would we call it? posh-git-ssh? There is already a posh-ssh on the PowerShell Gallery but it doesn't seem to deal with the agent or keys.

I might as well. @drusellers suggested posh-sshit, but that may be slightly inappropriate. Maybe posh-ssh-agent? Twitter can decide.

Also, will the upcoming Win32-OpenSSH implementation impact this?

Several of the open issues here are or have been about Win32-OpenSSH, so yes that's in scope.

+1 for posh-ssh-agent.

I am very bad at naming 馃槢
posh-ssh-agent sounds good 馃憤

Has anything happened with this? I'd be down to work on it

Thanks for the offer, @tamj0rd2! Nobody is actively working on this, as far as I know.

Before we spawn off a new repo, it seems like a good idea to try to review/merge the four existing Pull Requests. Do you want to start by taking a look at those, and bringing them up-to-date (conflicts everywhere!) if the changes are good? My time is relatively limited at the moment, but I'm glad to help and answer questions as I'm able.

I am not sure whether we should support this anymore for windows.
Currently Windows git client ships with git-credential-manager written by Microsoft. It's more reliable and much better compared to ssh-agent in Windows.

git-credential-manager is great for HTTPS, but as far as I know it doesn't handle SSH keys: https://github.com/Microsoft/Git-Credential-Manager-for-Windows/issues/25. I did find https://github.com/elsteelbrain/ssh-agent-helper via that issue.

At this point I'm tempted to just drop the ssh-agent helpers from 1.0.0 and deal with complaints (if any). Maybe someone will be motivated to pick up where we've left off here?

HTTPS is the way. We should discourage someone using HTTP ;)
Yes. Indeed we should decouple ssh-agent and poshgit

I can pickup given that once we clean out this from poshgit and see what we are going to miss/what we need from this

Hi @dahlbyk et al, as I mentioned on twitter I'm planning to do some work on this over the weekend.

This is what I'm currently thinking:

  • I'll add support for win10 1803 openssh (#583)
  • Even though win10 provides its own ssh-agent now, I think we should still provide this functionality. There may be legitimate reasons that users may want to run the openssh that ships as part of git for windows, or pageant.
  • I'll split up sshutils.ps1 into a separate module remove posh-git's dependency on it
  • Where do we want to host the module? I'm happy to host it under my github account, or you can host it under yours. Let me know.
  • I'll try and increase the test coverage while I'm at it

If anyone else has any thoughts on this please let me know

I'll post updates on this issue.

The primary advantages I see with the Windows the openssh ssh-agent is that A) because it runs as a service, I don't have to configure PowerShell to start the agent. The agent is always running. And B), I don't have to launch my dev tools (Visual Studio) from PowerShell in order for them to work with the ssh-agent. I can launch Visual Studio from my taskbar - which is how I prefer to do that.

For starters, I'm inclined to fix up the low-hanging SSH stuff (at least #583, maybe look at the open PRs assigned to the SSH Agents milestone?) in the v0 branch for a v0.8 release.

Once that's stable, we can cut it loose into a separate module and drop it from master here for the next v1 beta.

Where do we want to host the module? I'm happy to host it under my github account, or you can host it under yours. Let me know.

No preference. I can create a repo here, we can use a repo of your own, or we can see about hosting it under PoshCode.

Also, it would actually be nice to have native argument completion for ssh, ssh-keygen, ssh-keyscan, ssh-add, sftp, and scp. :-)

Also, it would actually be nice to have native argument completion for ssh, ssh-keygen, ssh-keyscan, ssh-add, sftp, and scp. :-)

It would! I'd like to address that too.

For starters, I'm inclined to fix up the low-hanging SSH stuff (at least #583, maybe look at the open PRs assigned to the SSH Agents milestone?) in the v0 branch for a v0.8 release.

I'll do separate PRs for these and keep them separate from the work on the standalone module.

Where do we want to host the module? I'm happy to host it under my github account, or you can host it under yours. Let me know.

No preference. I can create a repo here, we can use a repo of your own, or we can see about hosting it under PoshCode.

Or, option 3: keep it in this repo, and just manage it better. @JeremySkinner glad to make you a maintainer here to that end.

Another feature posh-ssh could provide is configuring Git to use Window's OpenSSH implementation via the env var GIT_SSH. That env var would need to be created at user or machine scope so that tools launched from the Start menu/taskbar would benefit. Then again, this might be something that Git for Windows supplies at some point?

Or, option 3: keep it in this repo, and just manage it better.

I've already talked myself out of this. We'll want to tag posh-ssh versions separately from posh-git.

Another feature posh-ssh could provide is configuring Git to use Window's OpenSSH implementation via the env var GIT_SSH.

Yes I think that's a good idea. We can always take it out in the future once git for windows supports it natively.

Do you think the env var is better than modifying the global .gitconfig?

Edit: I've just committed an initial attempt at win10 ssh support: #586

Do you think the env var is better than modifying the global .gitconfig?

Good question. I wasn't aware of the .gitconfig setting for this until very recently. Seems like that probably would be a better way to go. OTOH a machine env var would set this for all users but on Windows, how often are there actually mulitple users? Plus setting env vars at the machine level is a pain because it doesn't take effect for all processes until you logout/in or restart. So I'd say, go with the .gitconfig approach.

Another thing I'd like to add is bookmark manager commands for manipulating the .ssh/config file (similar to how stormssh works). I have a couple of very messy scripts for doing this at the moment. Once the module is split out I'd like to tidy them up and bring them across.

We can move it elsewhere if y'all want, but I've created https://github.com/dahlbyk/posh-ssh if you want to start creating issues there with a wishlist. Once we get v0 here in a good state, I'm thinking I'll just push this repo there and we can set about deleting all things posh-git. Unless you'd rather the repo not have posh-git baggage?

Sounds good, thanks

I'd call this issue resolved by the creation of posh-sshell.

Was this page helpful?
0 / 5 - 0 ratings