shell 端口映射
时间: 2023-08-25 15:19:02 浏览: 153
在Shell中,可以使用ssh命令实现端口映射。通过ssh命令的-L选项,可以将本地端口映射到远程主机上的指定端口。例如,使用以下命令将本地的9987端口映射到远程主机10.154.62.197的3306端口上:
ssh -CfNg -L 9987:10.154.62.197:3306 root@localhost -p 9999
这意味着,当在本地访问9987端口时,实际上访问的是远程主机上的10.154.62.197的3306端口。同样地,可以使用类似的命令进行多个端口的映射。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Linux Shell命令实现端口转发(端口映射)](https://blog.csdn.net/woshihyykk/article/details/106547789)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [adb端口映射](https://blog.csdn.net/jinc928/article/details/122649990)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文