I need to setup a solution similar to GitHub, where users can SSH to their git repository.
This should scale for hundreds of thousands of users, so my idea is to use a distributed filesystem for the data (so every node can access the entire data) and a replicated database to control the users (so again - every node can always access the entire list of users).
Using a normal authorized_keys file is impossible since users are not bound to a specific node, so I was looking for a way to read the list from a database (https://serverfault.com/a/443230/125948).
The problem with the AuthorizedKeysCommand command is that it only passes the username (which is my case - will be git for all users), so basically I would have to do a SELECT pub_key FROM user
and always return the ENTIRE list for every connection.
This obviously is not the proper solution, so I was looking for another way to authenticate. Basically my question is: how on earth GitHub are doing that?