Can you specify git-shell in .ssh/authorized_keys to restrict access to only git commands via ssh?

Posted by Matt Connolly on Super User See other posts from Super User or by Matt Connolly
Published on 2011-06-21T03:50:15Z Indexed on 2012/04/04 23:33 UTC
Read the original article Hit count: 253

Filed under:
|

I'd like to be able to use a ssh key for authentication, but still restrict the commands that can be executed over the ssh tunnel.

With Subversion, I've achieved this by using a .ssh/authorized_keys file like:

command="/usr/local/bin/svnserve -t --tunnel-user matt -r /path/to/repository",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAABIetc...

I've tried this with "/usr/bin/git-shell" in the command, but I just get the funky old fatal: What do you think I am? A shell? error message.

© Super User or respective owner

Related posts about ssh

Related posts about git