tunnel-2-by-jumphost


Nametunnel-2-by-jumphost JSON
Version 0.1.0 PyPI version JSON
download
home_page
Summary
upload_time2023-12-31 12:19:09
maintainer
docs_urlNone
authorYour Name
requires_python>=3.11,<4.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tunnel-2-by-jumphost

`tunnel-2-by-jumphost` 是一个用于通过跳板机连接内部 SSH 的 Python 工具,它适用于各种类似情况,如容器、Colab 等。

## 安装

您可以使用 pip 安装这个包:

```shell
pip install tunnel-2-by-jumphost
```

# 使用
## 服务器端
在跳板机上运行服务器端以接受外部连接并转发到目标内部 SSH。在跳板机上运行以下命令:

```shell
tunnel-2-by-jumphost-server s [public_2_external_port] [tunnel_port]
# tunnel-2-by-jumphost-server s 222 333
```

### [public_2_external_port] 
    用于接受外部连接。

### [tunnel_port] 
    用于接受跳转通道。

## 客户端
在您的本地机器上运行客户端以连接到跳板机并将数据传递到目标内部 SSH。在您的本地机器上运行以下命令:

```shell
tunnel-2-by-jumphost-client c [jump_host] [jump_host_tunnel_port] [relay_to_host] [relay_to_port]
#tunnel-2-by-jumphost-client c jump_host 333 localhost 22
```
### [jump_host]
    跳转服务器 IP 地址。
### [jump_host_tunnel_port]
    跳转服务器端口。
### [relay_to_host] 
    重定向到的主机。
### [relay_to_port] 
    重定向到的服务器。
# 示例
## 服务器端示例

在跳板机上运行服务器端:

```shell
tunnel-2-by-jumphost-server s [public_2_external_port] [tunnel_port]
# tunnel-2-by-jumphost-server s 222 333
```
这将在跳板机上启动服务器,它将在 192.168.1.100:8080 上接受外部连接,并将它们转发到 10.0.0.1:22。

## 客户端示例
在您的本地机器上运行客户端:

```shell
tunnel-2-by-jumphost-client c [jump_host] [jump_host_tunnel_port] [relay_to_host] [relay_to_port]
#tunnel-2-by-jumphost-client c jump_host 333 localhost 22
```

这将连接到跳板机 jump_host:333,然后将数据传递到内部 SSH 服务器 localhost:22

# 注意事项
确保可以从容器环境访问跳板机,请谨慎使用此工具,自行评估,使用此工具造成的任何问题,我没有责任。

# 许可证
本项目采用 MIT 许可证。有关详细信息,请参阅 LICENSE 文件。





            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tunnel-2-by-jumphost",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/b4/dc/921b57c1a504fb3820c8b2991cdecd34d466c38026e26d2691bfe904a91e/tunnel_2_by_jumphost-0.1.0.tar.gz",
    "platform": null,
    "description": "# tunnel-2-by-jumphost\n\n`tunnel-2-by-jumphost` \u662f\u4e00\u4e2a\u7528\u4e8e\u901a\u8fc7\u8df3\u677f\u673a\u8fde\u63a5\u5185\u90e8 SSH \u7684 Python \u5de5\u5177\uff0c\u5b83\u9002\u7528\u4e8e\u5404\u79cd\u7c7b\u4f3c\u60c5\u51b5\uff0c\u5982\u5bb9\u5668\u3001Colab \u7b49\u3002\n\n## \u5b89\u88c5\n\n\u60a8\u53ef\u4ee5\u4f7f\u7528 pip \u5b89\u88c5\u8fd9\u4e2a\u5305\uff1a\n\n```shell\npip install tunnel-2-by-jumphost\n```\n\n# \u4f7f\u7528\n## \u670d\u52a1\u5668\u7aef\n\u5728\u8df3\u677f\u673a\u4e0a\u8fd0\u884c\u670d\u52a1\u5668\u7aef\u4ee5\u63a5\u53d7\u5916\u90e8\u8fde\u63a5\u5e76\u8f6c\u53d1\u5230\u76ee\u6807\u5185\u90e8 SSH\u3002\u5728\u8df3\u677f\u673a\u4e0a\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a\n\n```shell\ntunnel-2-by-jumphost-server s [public_2_external_port] [tunnel_port]\n# tunnel-2-by-jumphost-server s 222 333\n```\n\n### [public_2_external_port] \n    \u7528\u4e8e\u63a5\u53d7\u5916\u90e8\u8fde\u63a5\u3002\n\n### [tunnel_port] \n    \u7528\u4e8e\u63a5\u53d7\u8df3\u8f6c\u901a\u9053\u3002\n\n## \u5ba2\u6237\u7aef\n\u5728\u60a8\u7684\u672c\u5730\u673a\u5668\u4e0a\u8fd0\u884c\u5ba2\u6237\u7aef\u4ee5\u8fde\u63a5\u5230\u8df3\u677f\u673a\u5e76\u5c06\u6570\u636e\u4f20\u9012\u5230\u76ee\u6807\u5185\u90e8 SSH\u3002\u5728\u60a8\u7684\u672c\u5730\u673a\u5668\u4e0a\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a\n\n```shell\ntunnel-2-by-jumphost-client c [jump_host] [jump_host_tunnel_port] [relay_to_host] [relay_to_port]\n#tunnel-2-by-jumphost-client c jump_host 333 localhost 22\n```\n### [jump_host]\n    \u8df3\u8f6c\u670d\u52a1\u5668 IP \u5730\u5740\u3002\n### [jump_host_tunnel_port]\n    \u8df3\u8f6c\u670d\u52a1\u5668\u7aef\u53e3\u3002\n### [relay_to_host] \n    \u91cd\u5b9a\u5411\u5230\u7684\u4e3b\u673a\u3002\n### [relay_to_port] \n    \u91cd\u5b9a\u5411\u5230\u7684\u670d\u52a1\u5668\u3002\n# \u793a\u4f8b\n## \u670d\u52a1\u5668\u7aef\u793a\u4f8b\n\n\u5728\u8df3\u677f\u673a\u4e0a\u8fd0\u884c\u670d\u52a1\u5668\u7aef\uff1a\n\n```shell\ntunnel-2-by-jumphost-server s [public_2_external_port] [tunnel_port]\n# tunnel-2-by-jumphost-server s 222 333\n```\n\u8fd9\u5c06\u5728\u8df3\u677f\u673a\u4e0a\u542f\u52a8\u670d\u52a1\u5668\uff0c\u5b83\u5c06\u5728 192.168.1.100:8080 \u4e0a\u63a5\u53d7\u5916\u90e8\u8fde\u63a5\uff0c\u5e76\u5c06\u5b83\u4eec\u8f6c\u53d1\u5230 10.0.0.1:22\u3002\n\n## \u5ba2\u6237\u7aef\u793a\u4f8b\n\u5728\u60a8\u7684\u672c\u5730\u673a\u5668\u4e0a\u8fd0\u884c\u5ba2\u6237\u7aef\uff1a\n\n```shell\ntunnel-2-by-jumphost-client c [jump_host] [jump_host_tunnel_port] [relay_to_host] [relay_to_port]\n#tunnel-2-by-jumphost-client c jump_host 333 localhost 22\n```\n\n\u8fd9\u5c06\u8fde\u63a5\u5230\u8df3\u677f\u673a jump_host:333\uff0c\u7136\u540e\u5c06\u6570\u636e\u4f20\u9012\u5230\u5185\u90e8 SSH \u670d\u52a1\u5668 localhost:22\n\n# \u6ce8\u610f\u4e8b\u9879\n\u786e\u4fdd\u53ef\u4ee5\u4ece\u5bb9\u5668\u73af\u5883\u8bbf\u95ee\u8df3\u677f\u673a\uff0c\u8bf7\u8c28\u614e\u4f7f\u7528\u6b64\u5de5\u5177\uff0c\u81ea\u884c\u8bc4\u4f30\uff0c\u4f7f\u7528\u6b64\u5de5\u5177\u9020\u6210\u7684\u4efb\u4f55\u95ee\u9898\uff0c\u6211\u6ca1\u6709\u8d23\u4efb\u3002\n\n# \u8bb8\u53ef\u8bc1\n\u672c\u9879\u76ee\u91c7\u7528 MIT \u8bb8\u53ef\u8bc1\u3002\u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 LICENSE \u6587\u4ef6\u3002\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0dc7325c4fcff6fdacb38dba29c7ebf8f4610e26ca4318cdd80d612577bd6332",
                "md5": "fbb82d75ee73d1893a04e686fbf03c65",
                "sha256": "8a46b46040b2aa6ba93081e53cb200abb442a3f5b8e1941a6e17695197ba4919"
            },
            "downloads": -1,
            "filename": "tunnel_2_by_jumphost-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fbb82d75ee73d1893a04e686fbf03c65",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4.0",
            "size": 3563,
            "upload_time": "2023-12-31T12:19:06",
            "upload_time_iso_8601": "2023-12-31T12:19:06.537813Z",
            "url": "https://files.pythonhosted.org/packages/0d/c7/325c4fcff6fdacb38dba29c7ebf8f4610e26ca4318cdd80d612577bd6332/tunnel_2_by_jumphost-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b4dc921b57c1a504fb3820c8b2991cdecd34d466c38026e26d2691bfe904a91e",
                "md5": "af0ede9c3632eae42e825d6b4eb4020f",
                "sha256": "9e95c7a5f973c0d9f5ee903a7cfab33d37892ac90fb2294621bcf8c561128100"
            },
            "downloads": -1,
            "filename": "tunnel_2_by_jumphost-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "af0ede9c3632eae42e825d6b4eb4020f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0",
            "size": 2724,
            "upload_time": "2023-12-31T12:19:09",
            "upload_time_iso_8601": "2023-12-31T12:19:09.295959Z",
            "url": "https://files.pythonhosted.org/packages/b4/dc/921b57c1a504fb3820c8b2991cdecd34d466c38026e26d2691bfe904a91e/tunnel_2_by_jumphost-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-31 12:19:09",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "tunnel-2-by-jumphost"
}
        
Elapsed time: 0.26785s