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
- add passwd for admin user, such as $PASSWORD
- installed SSHD:
设置 -> 软件 -> 可选功能 -> 安装 OpenSSH 服务器 - start SSHD with powershell ->
net start sshd
- 禁止休眠:
设置 -> 系统 -> 电源和睡眠 - 找到 PC 的内网 IP, 记做
$WIP
on your machine
1. test connecting to Windows SSHD, then quit:
ssh admin@$WIP
# with $PASSWORD
2. setup ssh forwarding:
ssh -L 0.0.0.0:2022:$DEV:22 admin@$WIP
3. connect dev machine:
ssh $DEV_USER@localhost -p 2022
that’s it.