restrict authorized_keys

command="/home/someuser/rsync/checkrsync",from="trusted.eng.cam.ac.uk",no-port-forwarding,no-X11-forwarding,noagent-forwarding,no-pty ssh-rsa AAAAB

 checkrsnc:

#!/bin/sh

case "$SSH_ORIGINAL_COMMAND" in
        *\&*)
                echo "Rejected"
                ;;
        *\(*)
                echo "Rejected"
                ;;
        *\{*)
                echo "Rejected"
                ;;
        *\;*)
                echo "Rejected"
                ;;
        *\<*)
                echo "Rejected"
                ;;
        *\`*)
                echo "Rejected"
                ;;
        rsync\ --server*)
                $SSH_ORIGINAL_COMMAND
                ;;
        *)
                echo "Rejected"
                ;;
esac
 

你可能感兴趣的:(ssh)