Skip to content

Instantly share code, notes, and snippets.

@jhass
Last active May 17, 2019 08:46
Show Gist options
  • Save jhass/5052ed536a351d86c7c572c8a36cfb92 to your computer and use it in GitHub Desktop.
Save jhass/5052ed536a351d86c7c572c8a36cfb92 to your computer and use it in GitHub Desktop.
Git shell only for specific SSH key
command="/home/USER/.ssh/git-shell",no-port-forwarding,no-X11-forwarding,no-pty ssh-rsa YOUR_KEY foo
#!/bin/sh
if [ -z "$SSH_ORIGINAL_COMMAND" ]; then
exec /usr/bin/git-shell
else
exec /usr/bin/git-shell -c "$SSH_ORIGINAL_COMMAND"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment