A:雲服務器
B:內網主機A 192.168.66.250
C:內網主機B 192.168.66.240
B:
ssh -p 22 -fNR 22222:localhost:22 [email protected]
A:
ssh -fNg -L 9099:localhost:22222 localhost
C:
ssh -p 9099 [email protected]
autossh -M 10900 -fN -o "PubkeyAuthentication=yes" -o "StrictHostKeyChecking=false" -o "PasswordAuthentication=no" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R A.ip:10022:localhost:22 relayserver_user@1.1.1.1