Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- user=$1 # git !
- filter=$2 # @$
- cat /home/git/.ssh/authorized_keys 2>/dev/null | grep "${filter:-@$}"
- exit 0
- ExposeAuthInfo yes
- Match User git
- AuthorizedKeysCommand /path/to/authorizedkeyscommand git # @$ as default
- ForceCommand /path/to/forcecommand git
- #!/bin/ksh
- set -x
- user=$1 # git
- if [[ -r ${SSH_USER_AUTH} ]]; then
- pubkey="$(cat ${SSH_USER_AUTH} | cut -d' ' -f2-)"
- realuser=$(/path/to/authorizedkeyscommand git | grep "${pubkey}" | sed 's/^.* ([^@]*)@$/1/' )
- [[ -n ${realuser} ]] && exec ssh -i $HOME/${realuser}_key <final_destination> "${SSH_ORIGINAL_COMMAND:-}"
- else
- exit 1
- fi
Add Comment
Please, Sign In to add comment