Help for this page
# ssh $HOST "cat > /tmp/script" << ! rm -f /tmp/files /tmp/contents ... exit 0 ! # ssh $HOST "sudo sh /tmp/script"