In principle it's the same as quinn's answer, but as a working script instead of separate commands which need adaption for each machine/usage.
I don't know about the overhead in this, it seems to me like it encrypts/decrypts everything twice.
#!/bin/bash
# Reverse sshfs. You need ssh servers on both ends, the script logs first
# onto the remote end and then back into the local one
# Usage: sshfsr dir [user@]host:mountpoint [options]
# [options] are passed on to the remote sshfs
set -e
LOCALPATH=$1
REMOTE=$(echo $2 | grep -o '^[^:]*')
REMOTEPATH=$(echo $2 | grep -o '[^:]*$')
ARGS=${@:3}
LOCALUSER=$(whoami)
PORT=10000
ssh $REMOTE -R $PORT:localhost:22 "sshfs -o NoHostAuthenticationForLocalhost=yes -p $PORT $ARGS $LOCALUSER@localhost:$LOCALPATH $REMOTEPATH" &
I disable HostAuthenticationForLocalhost because obviously localhost can be anything. This is perfectly safe with public key authentication. You shouldn't use passwords anyway, but even with passwords you are connecting to a host you know you control.
@quinn you should post the solution in that blog as an answer here. It works for me. – brismuth – 2015-05-22T16:08:02.853
@quinn is it working solution? – Konga Raju – 2014-04-18T04:29:44.777
Yes, I'm using it currently, seems to work fine – quinn – 2014-04-18T05:14:18.740
Actually, I have one issue: https://superuser.com/questions/743316/how-can-you-execute-files-mounted-via-sshfs
– quinn – 2014-04-18T11:31:22.260