A:云服务器

B:内网主机A 192.168.66.250

C:内网主机B 192.168.66.240

B:

ssh -p 22 -fNR 22222:localhost:22 root@A.ip

A:

ssh -fNg -L 9099:localhost:22222 localhost

C:

ssh -p 9099 root@A.ip

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