In case anybody is interested, having a bare git repo on a server is as easy as:
# locally
ssh git@example.com
# server
mkdir repo.git
cd repo.git
git --bare init
# locally
git remote add origin ssh://git@example.com/home/git/repo.git
git push origin master
P.S. I know it does not have the same features as github
It has all the same working features as github
If it's your ssh server and it's single user you don't need to use the "git@" part at all.
Just store the repo and access it with your account.
The whole git@ thing is because most "forge" software is built around a single dedicated user doing everything, rather than taking advantage of the OS users, permissions and acl system.
For a single user it's pointless. For anyone who knows how to setup filesystem permissions it's not necessary.
I prefer to be explicit about which user is connecting to ssh.
There isn't much advantage that can be taken from O/S users and perms anyway, at least as far as git is concerned. When using a shared-filesystem repository over SSH (or NFS etc.), the actually usable access levels are: full, including the abilities to rewrite history, forge commits from other users, and corrupt/erase the repo; read-only; and none.