The short answer: don't
Instead, use ssh. You can specify a command to do when ssh logs in. for example
Let's say you have a file foo.tar.bz2 on a remote server (work.workdomain) that you would like to extract on your local server, and lets say that this is a very large file, so you don't want to download it, then extract.
$ ssh work.workdomain 'echo "testing"'
One way around this problem is to do the following:
This will transfer the whole archive, and extract it to the current directory.
$ ssh work.workdomain 'cat foo.tar.bz2' | tar -jxv