I've been successful connecting to my office Mac workstation using SSH port forwarding:
ssh -R 31415:127.0.0.1:31415 -R 31416:127.0.0.1:31416 [email protected] "/Applications/Mathematica.app/Contents/MacOS/MathKernel -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName [email protected],[email protected] -LinkHost 127.0.0.1"
ssh -R 31415:127.0.0.1:31415 -R 31416:127.0.0.1:31416 [email protected] "/Applications/Mathematica.app/Contents/MacOS/MathKernel -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName [email protected],[email protected] -LinkHost 127.0.0.1"
where [email protected]
should be replaced with your SSH user name and the IP address of the remote machine. If the remote machine is running Linux, replace
/Applications/Mathematica.app/Contents/MacOS/MathKernel
/Applications/Mathematica.app/Contents/MacOS/MathKernel
with the appropriate path of the MathKernel executable.