Howto connect to github from custom ssh library


I’ve written my own ssh libraries for sharing and communicating on the Linux desktop (but not limited to).

Already working: sharing files using sftp, todo: sftp subsystem on server, ssh server, backup, text/video chat, desktop sharing using nx, portforwarding to client for example cups and MySQL. See: GitHub - stefbon/OSNS: Open Secure Network Services

I’m now busy adding support for Windows Networking (SMB2/3) using the library libsmb2 (GitHub - sahlberg/libsmb2: SMB2/3 userspace client).

Now in near future I want to add support for git to the FUSE fs: user can browse repositories, get notified of actions like someone forked as he/she wishes.
Now how do I connect to the github resources using my own ssh libraries. To compare: to use sftp over ssh, first a connection has to be made, and then the sftp subsystem has to be started over a dedicated channel, and initialized.
How does this with Github. Is there also a subsystem, or portforwarding?

Thanks in advance,
Stef Bon

Windows 10 has recently blocked those protocols, so most users will have to manually enable them in order to use them (but they’re really unsafe to keep them available on the machine).

SSH is just the protocol used by Git do exchange data during its operations. For GitHub resources you’ll have to use the GitHub API instead, which is not related to SSH.

Hi I know that ssh is used for the connection, and git is used on top of that. But how does this work? SFTP over ssh works via a subsystem, how does git over ssh work? Does it also use a subsystem?


Ok.It’s easier than I thought it is. It’s just using the “exec” call:

Thanks for pointing in this direction. I really thought it was something like port forwarding to the git server, but no.


Ok in the section in the book the lowlevel git protocol is described briefly. Do you know a guide, a rfc or any other document where the protocol is described in detail?


Stef Bon

You’ll find something here, but I’m not sure it’s as low level as you might expect: