Windows as Jump Server

purpose

graph LR Mac(Your Machine) --> Windows --> Dev(Dev Machine)

info

please set the variable beforehand

host IP
Windows IP $WIP
Windows username admin
Windows password $PASSWORD
Dev Machine IP $DEV
Dev Machine username $DEV_USER

steps

on Windows

  1. add passwd for admin user, such as $PASSWORD
  2. installed SSHD:
    设置 -> 软件 -> 可选功能 -> 安装 OpenSSH 服务器
  3. start SSHD with powershell -> net start sshd
  4. 禁止休眠:
    设置 -> 系统 -> 电源和睡眠
  5. 找到 PC 的内网 IP, 记做 $WIP

on your machine

1. test connecting to Windows SSHD, then quit:

ssh [email protected]$WIP
# with $PASSWORD

2. setup ssh forwarding:

ssh -L 0.0.0.0:2022:$DEV:22 [email protected]$WIP

3. connect dev machine:

ssh $DEV_USER@localhost -p 2022

that’s it.


2021-07-01 02:56 +0000