Right, but then the time comes when not all repos should be accessible to all developers. And access by SSH means more than just be able to do a git push/pull/clone. Those "easy" solutions tend to get quite problematic over time.
You can change the shell for the git user to git-shell, which will prevent them from running anything but git commands (As far as I'm aware that's all GitHub does on their servers).
If you're after something that doesn't give devs access to certain repos, you can always symlink like Håvard Pedersen mentioned; although if you're wanting something like that, you're probably better off with a solution like GitLab anyway.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
How do you share git repositories with this solution?
The same way you'd share files on any Linux server. For a development team, I'd probably make a team account and add all users keys to that user.
Right, but then the time comes when not all repos should be accessible to all developers. And access by SSH means more than just be able to do a git push/pull/clone. Those "easy" solutions tend to get quite problematic over time.
You can change the shell for the git user to git-shell, which will prevent them from running anything but git commands (As far as I'm aware that's all GitHub does on their servers).
If you're after something that doesn't give devs access to certain repos, you can always symlink like Håvard Pedersen mentioned; although if you're wanting something like that, you're probably better off with a solution like GitLab anyway.