SSH reverse tunel over public host

@Office

cat <<EOF> ~/bin/proxy-ssh-forward.sh
#!/bin/bash
 
PROXY_SERVER=proxy.example.com
 
eval \$(ssh-agent) && ssh-add
 
while true; do
    echo "Connect to proxy ..."
    ssh -a -v -N -R 7422:localhost:22 -o ServerAliveInterval=30 -o ServerAliveCountMax=10 \${PROXY_SERVER}
    sleep 10
done
EOF
 
chmod +x ~/bin/proxy-ssh-forward.sh
nohup ~/bin/proxy-ssh-forward.sh

@Home

cat <<EOF>> ~/.ssh/config.d/office
Host proxy.example.com
Hostname 1.2.3.4
User foo
 
Host proxy-ssh-office
Hostname 127.0.0.1
Port 7422
User bar
#ForwardAgent yes
ProxyCommand ssh proxy.example.com -W %h:%p
EOF
 
ssh proxy-ssh-office
# forward DNS
cat <<EOF>> ~/bin/vpn-mr-proxy.sh
#!/bin/bash
 
/usr/bin/sshuttle \
  --dns \
  192.168.1.0/24 \
  --exclude 192.168.178.0/24 \
  --remote proxy-ssh-office
EOF