Why is there a sshd in Git Bash?

2,735 views
Skip to first unread message

Claudiu Avram

unread,
May 27, 2016, 9:37:09 AM5/27/16
to git-for-windows

Hi guys,

Sorry if this question was asked before, but I couldn't find any helpful answer to this.


Git for Windows contains the file /usr/bin/sshd

Could it be that Git Bash has a ported the sshd executable by mistake?

This post indicates that there is no ssh server in msysGit.


Side note:

Don't know how relevant it is, but running it directly outputs 
sshd re-exec requires execution with an absolute path


Why would the Windows installation of Git contain this executable if it's useless?


Regards,

Claudiu

Johannes Schindelin

unread,
May 27, 2016, 11:45:46 AM5/27/16
to Claudiu Avram, git-for-windows
Hi Claudiu,

On Fri, 27 May 2016, Claudiu Avram wrote:

> Git for Windows contains the file */usr/bin/sshd*

This is inherited from MSYS2's openssh package.

> Could it be that Git Bash has a ported the sshd executable by mistake?

No, Git Bash did not port anything ;-)

And the Git for Windows did not port sshd either (and you cannot port an
executable, only the source code).

The MSYS2 project did all the work to make openssh (including the SSH
daemon) compile on Windows.

It is not the only unused file in Git for Windows; I had to strike a
balance between maintenance cost and file size. The task of weeding out
sshd in favor of shaving off just a few kilobytes off of the installer
fell under the cutting table, I am afraid.

> This post
> <http://serverfault.com/questions/702189/does-git-has-built-in-ssh-server> indicates
> that there is no ssh server in msysGit.

Well, are you now talking about msysGit? Remember: msysGit is the SDK that
was used to develop Git for Windows 1.x. You reached the mailing list
discussing GIt for Windows 2.x (since the 1.x branch was abandoned).

> Why would the Windows installation of Git contain this executable if it's
> useless?

That is easy: because nobody put in the work to exclude it from the
installer.

Ciao,
Johannes

Dale Wyttenbach

unread,
Mar 3, 2018, 11:00:34 AM3/3/18
to git-for-windows
It's not useless, why would anyone have a problem with it being included?
I use it all the time.

Konstantin Khomoutov

unread,
Mar 5, 2018, 3:25:32 AM3/5/18
to Dale Wyttenbach, git-for-windows
On Wed, Feb 28, 2018 at 09:23:43AM -0800, Dale Wyttenbach wrote:

[...]
> > Sorry if this question was asked before, but I couldn't find any helpful
> > answer to this.
> >
> > Git for Windows contains the file */usr/bin/sshd*
> >
> > Could it be that Git Bash has a ported the sshd executable by mistake?
> >
> > This post
> > <http://serverfault.com/questions/702189/does-git-has-built-in-ssh-server> indicates
> > that there is no ssh server in msysGit.
> >
> > Side note:
> >
> > Don't know how relevant it is, but running it directly outputs
> > sshd re-exec requires execution with an absolute path
> >
> > Why would the Windows installation of Git contain this executable if it's
> > useless?
> It's not useless, why would anyone have a problem with it being included?
> I use it all the time.

Please see [1], and especially the comment [2].

(On a side note, as to why «Why would the Windows installation of Git contain
this executable if it's useless?», my take is that this is merely an
artefact of the build process. Supposedly this can be fixed by not
packaging this binary but there surely exist more pressing things to
fix.)

1. https://github.com/git-for-windows/git/issues/1466
2. https://github.com/git-for-windows/git/issues/1466#issuecomment-361891065

Dale Wyttenbach

unread,
Mar 5, 2018, 8:47:04 AM3/5/18
to Konstantin Khomoutov, git-for-windows
Thanks for the reply...My point is, please don't remove it as it is useful when you want to run a git server.
It fits the decentralized model of git to allow and encourage the use of multiple servers, instead of assuming the presence of a single master server.

Johannes Schindelin

unread,
Mar 7, 2018, 2:31:42 AM3/7/18
to Dale Wyttenbach, Konstantin Khomoutov, git-for-windows
Hi Dale,

On Mon, 5 Mar 2018, Dale Wyttenbach wrote:

> Thanks for the reply...My point is, please don't remove it as it is useful
> when you want to run a git server.

No worries, we would need somebody to contribute a patch to remove it, and
you know how it is: commenting (even via mail) and telling other people
what they should do is so much easier than doing anything yourself.

> It fits the decentralized model of git to allow and encourage the use of
> multiple servers, instead of assuming the presence of a single master
> server.

Interesting. I did (and do) use sshd a bit on my machines, but not so much
for pushing and pulling (instead, I have a couple of tmux sessions which I
can then share between different VMs). I never thought that anybody else
used sshd on Windows, too... And of course I use the sshd from the Git for
Windows SDK, so it would not matter to me whether it was removed from the
Git for Windows installer or not.

Would you mind writing up a guide how to use sshd to allow for such
decentralized development, maybe even on the Git for Windows wiki at
https://github.com/git-for-windows/git/wiki?

Thank you,
Johannes

Dale Wyttenbach

unread,
Mar 7, 2018, 12:30:20 PM3/7/18
to Johannes Schindelin, Konstantin Khomoutov, git-for-windows
Hi Johannes,

I took a stab at creating the wiki page:

Apropos of nothing, my son's name is Johannes.  It's unusual here in the USA but he's named after my great-grandfather who emigrated from CH.

Thanks again!
Reply all
Reply to author
Forward
0 new messages