Mobaxterm: Local port forwarding Remote port forwarding

news2025/3/28 7:18:52

文章目录

  • Remote port forwarding
  • Local port forwarding
  • Appendix: Deploy clash in docker

Remote port forwarding

If you want to share the proxy on your local machine with the remote server, use Remote port forwarding.

Consider this scenario: There is no proxy configured in the remote server, you may fail to install software using the apt command, download code repositories using git clone, or access docker hub due to network problems, but in your laptop you have installed Clash for Windows, then you can share it with the remote server without installing clash on the server.

Follow these steps:

  1. In Mobaxterm, open Tools->MobaSSHTunnel(port forwarding)
    在这里插入图片描述
  2. Open New SSH tunnel
    在这里插入图片描述
  3. Set the port forwarding parameters
  • <Local server>: 127.0.0.1
  • <Local port>: 7890 (the port of your clash)
  • <SSH server>: remote server’s ip (for example 10.xxx.xxx.xxx)
  • <SSH login>: your username on the remote server
  • <SSH port>: 22
  • <Forwarded port>: 7890 (if you want to use port 7890 of the server for proxy)
    在这里插入图片描述
    Then Save and click Start button to enable forwarding.
  1. In the server, set the proxy parameters
  • proxy for bash
export http_proxy="http://127.0.0.1:7890" && export https_proxy="http://127.0.0.1:7890"
  • proxy for apt
sudo vim /etc/apt/apt.conf.d/proxy.conf

In proxy.conf, add these contents

Acquire {
  http::proxy "http://127.0.0.1:7890";
  https::proxy "http://127.0.0.1:7890";
}
  • proxy for docker daemon
sudo vim /etc/systemd/system/docker.service.d/proxy.conf

In proxy.conf, add these contents

[Service]
Environment="HTTP_PROXY=127.0.0.1:7890"
Environment="HTTPS_PROXY=127.0.0.1:7890"
Environment="NO_PROXY=localhost,127.0.0.1,.example.com"
sudo systemctl daemon-reload && sudo systemctl restart docker
  • proxy for docker container
vim ~/.docker/config.json

In config.json, add these contents and replace 192.168.xxx.xxx with the real IP address of the remote server (do not use 127.0.0.1)

{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://192.168.xxx.xxx:7890/",
     "httpsProxy": "http://192.168.xxx.xxx:7890/",
     "noProxy": "localhost,127.0.0.1"
   }
 }
}
  1. Now you have completed all the settings. Next time if you want to share the proxy when you connect to the same server, just click Start button to enable forwarding.

Local port forwarding

If you have installed clash on your server and you want to manage it through the web UI, use Local port forwarding.

Clash provides a web UI (https://clash.razord.top/#/proxies). After setting external-controller in ~/.config/clash/config.yaml, users can use the web UI to manage Clash through the specified port.

For example, in config.yaml external-controller: 0.0.0.0:9090, you can access the web UI through 10.xxx.xxx.xxx:9090, but if the server firewall does not open port 9090, you can use Local port forwarding to map port 9090 to other ports such as 9090 or 9091 on the local machine, and then access the local port.

在这里插入图片描述

  • <Remote server>: 127.0.0.1
  • <Remote port>: 9090 (the port of external-controller)
  • <SSH server>: remote server’s ip (for example 10.xxx.xxx.xxx)
  • <SSH login>: your username on the remote server
  • <SSH port>: 22
  • <Forwarded port>: 9091 (if you want to use port 9091 of your local machine to access the clash Web UI in the server)

Appendix: Deploy clash in docker

docker-compose.yaml

services:
  clash:
    image: dreamacro/clash-premium:2023.08.17
    restart: always
    volumes:
      - ./config.yaml:/root/.config/clash/config.yaml:ro
      # - ./yacd-gh-pages:/root/.config/clash/ui:rwx # 仪表盘 Volume 映射
    ports:
      - "7890:7890"
      - "7891:7891"
      - "9090:9090" # 外部控制 (RESTful API)
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    network_mode: "host"

You can copy config.yaml from your computer.

  • Start
docker compose up -d
  • Stop
docker compose down
  • View logs
docker compose logs

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2301222.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

DeepSeek模型快速部署教程-搭建自己的DeepSeek

前言&#xff1a;在人工智能技术飞速发展的今天&#xff0c;深度学习模型已成为推动各行各业智能化转型的核心驱动力。DeepSeek 作为一款领先的 AI 模型&#xff0c;凭借其高效的性能和灵活的部署方式&#xff0c;受到了广泛关注。无论是自然语言处理、图像识别&#xff0c;还是…

用友U8 固定资产-批量变动单

前提&#xff1a;没有结账&#xff0c;没有结账&#xff0c;没有结账 如果已经结账&#xff0c;可反结账 1.需要先计提折旧&#xff0c;操作路径是点击【固定资产】-【计提折旧】-计提本月折旧 2.进行资产减少操作&#xff0c;点击【资产处置】-【资产减少】&#xff0c;如…

基于微信小程序的电影院订票选座系统的设计与实现,SSM+Vue+毕业论文+开题报告+任务书+指导搭建视频

本系统包含用户、管理员两个角色。 用户角色&#xff1a;注册登录、查看首页电影信息推荐、查看电影详情并进行收藏预定、查看电影资讯、在线客服、管理个人订单等。 管理员角色&#xff1a;登录后台、管理电影类型、管理放映厅信息、管理电影信息、管理用户信息、管理订单等。…

自然语言处理NLP 02统计语言模型

目录 jieba中文分词 TF-IDF TF&#xff08;词频&#xff0c;Term Frequency&#xff09; IDF&#xff08;逆文档频率&#xff0c;Inverse Document Frequency&#xff09; 总结 案例&#xff1a;从文本数据中提取并分析关键词的重要性 jieba中文分词 jieba 是一个强大的…

Qt开发④Qt常用控件_上_QWdget属性+按钮类控件

目录 1. 控件概述和发展 2. QWidget 核心属性 2.1 核心属性概览 2.2 enabled 是否可用 2.3 geometry 位置尺寸 2.4 windowTitle 标题 2.5 windowIcon 图标 2.6 windowOpacity 不透明度 2.7 cursor 光标 2.8 font 字体 2.9 toolTip 鼠标悬停提示 2.10 focusPolicy 焦…

Apache Struts RCE (CVE-2024-53677)

前言 对目前的Apache Struts RCE (CVE-2024-53677)的poc进行总结&#xff0c;由于只能单个ip验证&#xff0c;所以自己更改一下代码&#xff0c;实现&#xff1a;多线程读取url验证并保存&#xff0c;更改为中文解释 免责声明 请勿利用文章内的相关技术从事非法测试&#xf…

23. AI-大语言模型-DeepSeek

文章目录 前言一、DeepSeek是什么1. 简介2. 产品版本3. 特征4. 地址链接5. 三种访问方式1. 网页端和APP2. DeepSeek API 二、DeepSeek可以做什么1. 应用场景2. 文本生成1. 文本创作2. 摘要与改写3. 结构化生成 3. 自然语言理解与分析1. 语义分析2. 文本分类3. 知识推理 4. 编程…

成人床垫更新关于 SOR/2016-183 和《纺织品贴标和广告法规》的合规

成人床垫更新关于 SOR/2016-183 和《纺织品贴标和广告法规》的合规性声明 加拿大站成人床垫法规SOR/2016-183是强制性的 。为确保买家安全并遵守相关法规&#xff0c;亚马逊要求所有在加拿大销售的成人床垫必须符合《床垫法规》规定的安全标准&#xff0c;包括SOR/2016-183。此…

11.编写前端内容|vscode链接Linux|html|css|js(C++)

vscode链接服务器 安装VScode插件 Chinese (Simplified) (简体中⽂) Language Pack for Visual Studio CodeOpen in BrowserRemote SSH 在命令行输入 remote-ssh接着输入 打开配置文件&#xff0c;已经配置好主机 点击远程资源管理器可以找到 右键链接 输入密码 …

网工项目实践2.6 广域网需求分析及方案制定

本专栏持续更新&#xff0c;整一个专栏为一个大型复杂网络工程项目。阅读本文章之前务必先看《本专栏必读》。 全网拓扑展示 一.广域网互联方式 1.专线 优点 稳定 独享。绝对安全。可靠性高&#xff0c;带宽高&#xff0c;完全取决于终端接口。 缺点: 费用高。建设时间长。难…

大模型相关学习

知识科普 为什么不直接使用网页版 DeepSeek? 我们的需求&#xff1a;绝对的隐私保护和个性化知识库构建。场景&#xff1a;若希望大模型能根据企业规章制度来回答问题&#xff0c;一般需上传企业规章制度的附件&#xff0c;但仍可能面临问题。 数据隐私问题&#xff1a;联网使…

基于Java(JSP)+MySQL设计与实现的 MVC 鲜花订购系统

基于MVC的鲜花订购系统的设计与实现 摘 要 摘 要&#xff1a;鲜花订购系统与网络相结合&#xff0c;给用户提供更加周到和人性化的服务。网站模式为MVC模式&#xff0c;基于MySql数据库,采用Jsp&#xff0c;Session绘画跟踪、JavaScript等技术,实现了普通用户可以浏览、查看鲜…

网络原理-

文章目录 协议应用层传输层网络层 数据链路层 协议 在网络通信中,协议是非常重要的概念.协议就是一种约定. 在网络通信过程中,对协议进行了分层 接下来就按照顺序向大家介绍每一种核心的协议. 应用层 应用层是咱们程序员打交道最多的一层协议.应用层里有很多现成的协议,但…

解码 NLP:从萌芽到蓬勃的技术蜕变之旅

内容概况&#xff1a; 主要讲述NLP专栏的内容和NLP的发展及其在现代生活中的广泛应用。课程强调实践为主、理论为辅的学习方法&#xff0c;并通过多个生活场景展示了NLP技术的实际应用&#xff0c;如对话机器人、搜索引擎、翻译软件、电商推荐和智能客服等。 这边我就不多做自我…

Word中的文档信息域

Word中的文档信息域 DocProperty包含文档信息的多个属性, 也可以自定义属性. 查看文档预定义的自定义属性 【文件】→【信息】→【属性】→【高级属性】 参考链接 WORD中文档属性域DocProperty的应用-CSDN博客 第06套 Word_哔哩哔哩_bilibili

java机器学习计算指标动态阈值

java机器学习计算指标动态阈值 最近听到有的人说要做机器学习就一定要学Python&#xff0c;我想他们掌握的知道还不够系统全面。本文作者以动态阈值需求场景给大家介绍几种常用Java实现的机器学习库&#xff0c;包括使用开源库如Weka或Deeplearning4j&#xff08;DL4J&#xf…

Note25021902_TIA Portal V18 WinCC BCA Ed 需要.NET 3.5 SP1

TIA Portal V18 WinCC BCA Ed 需要.NET 3.5 SP1 在安装TIA Portal V18时&#xff0c;遇到TIA Portal V18 WinCC BCA Ed 需要.NET 3.5 SP1. 请在此PC上中启用.NET 3.5 SP1&#xff1b; 检索&#xff1a; 电脑上如何启用 .NET 3.5 SP1 参考资料1&#xff1a; https://baijiahao.…

CHARMM-GUI EnzyDocker: 一个基于网络的用于酶中多个反应状态的蛋白质 - 配体对接的计算平台

❝ "CHARMM-GUI EnzyDocker for Protein−Ligand Docking of Multiple Reactive States along a Reaction Coordinate in Enzymes"介绍了 CHARMM-GUI EnzyDocker&#xff0c;这是一个基于网络的计算平台&#xff0c;旨在简化和加速 EnzyDock 对接模拟的设置过程&…

阅读论文笔记《Translating Embeddings for Modeling Multi-relational Data》

目录 一、模型核心原理剖析二、实验设计与数据集选择三、实验结果深度解读&#xff08;一&#xff09;链接预测实验&#xff08;二&#xff09;关系分类实验&#xff08;三&#xff09;链接预测示例&#xff08;四&#xff09;泛化实验 四、模型优缺点总结&#xff08;一&#…

​实在智能与宇树科技、云深科技一同获评浙江省“人工智能服务商”、 “数智优品”​等荣誉

近日&#xff0c;浙江省经信厅正式公布《2024 年浙江省人工智能应用场景、应用标杆企业、人工智能服务商及 “数智优品” 名单》。 实在智能获评浙江省“人工智能服务商”&#xff0c;核心产品 “实在 Agent 智能体” 入选 “数智优品”。一同获此殊荣的还有宇树科技、云深处科…