Created
November 20, 2014 13:22
-
-
Save woglinde/0a7629a29e2228c4ac88 to your computer and use it in GitHub Desktop.
ssh force command demonstration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
logger "SSH COMMAND is $SSH_ORIGINAL_COMMAND" | |
if test -n "$SSH_ORIGINAL_COMMAND" -a parse_to_allow($SSH_ORIGINAL_COMMAND) ; then | |
/bin/bash -c "$SSH_ORIGINAL_COMMAND" | |
else | |
logger "shell access denied" | |
fi | |
# pseudo code | |
parse_to_allow(sshcommand){ | |
if sshcommand in ${allowcommands} | |
return 0 | |
else | |
return 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment