Refer to SSH tunnel manual login
https://blog.csdn.net/hushui/article/details/106212429
Note
1. Aliyun 需要打开控制台/安全组规则 https://ecs.console.aliyun.com/ 允许 port /tcp/9999 and 9901
2. Centos firewall setting
firewall-cmd --list-all
firewall-cmd --zone=public --add-port=9999/tcp --permanent
firewall-cmd --reload
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : WindowsHOME
IPv4 Address. . . . . . . . . . . : 10.73.XXX.XXX
Subnet Mask . . . . . . . . . . . : 255.255.255.0
1. Step on Windows side Win10 has OpenSSH Server now!
Windowds tunnels to AliyunServer(47.100.XXX.XXX) port 9901
windows ==>
ssh -C -f -N -o ServerAliveInterval=600 -R 9901:127.0.0.1:22 lake@AliyunServer
ssh tunnel : WindowsHome:22<======== AliyunServer:9901
2.Step2 on AliyunServer(47.100.XXX.XXX) WindowsHome IP 10.73.XXX.XXX
[lake@AliyunServer ~]$ ssh -p9901 WindowsHomeAccount@localhost ==> Windows SSH server test
[lake@AliyunServer ~]$ ssh -f -N WindowsAccount@localhost -p9901 -L 0.0.0.0:9999:WindowsHome:3389
ssh tunnel : WindowsHome:3390 <======== AliyunServer:9999
3. Outside Remote Desktop ========> AliyunServer:9999 =======> WindowsHome:3389
4. reconnect loop Refer to
SSH tunnel/backgroud automatic 自动后台 (https://blog.csdn.net/hushui/article/details/107334246)
Refer to
https://blog.netnerds.net/2017/12/updated-ssh-tunneling-for-windows-people-protecting-remote-desktop/