ssh端口转发命令

ssh -L 本地端口:目标主机地址:目标主机端口 user@跳板机地址
例子:
想要通过跳板机访问百度
1.打开shell进行端口转发配置

ssh -L 7777:www.baidu.com:80 root@跳板机地址

2.发送请求

http://localhost:7777

3.如果是https,如https://abc.com/a/b
需要先在/etc/hosts中做如下配置

127.1 abc.com

端口转发命令

ssh -L 7777:abc.com:443 root@跳板机地址

发送请求

https://abc.com:7777/a/b

猜你喜欢

转载自blog.csdn.net/litterfrog/article/details/79162765