windows内网端口映射到外网(可直接映射远程桌面的端口,直连)

1.windows没有外网IP,但是可以直连外网

2.有一台有外网IP的linux机器

3.windows安装openssh ,安装方法:

1.下载

https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH

2.解压,并将文件重命名OpenSSH 移动到C:\Program Files

   3.管理员运行cmd命令进入到C:\Program Files  ,运行

  • powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1

4.做端口映射 : ssh -N -R 0.0.0.0:3389:localhost:3389 root@外网IP

之后链接远程桌面便直接用外网IP了

猜你喜欢

转载自blog.csdn.net/yangwy012210/article/details/89314808