python - 通过隧道连接(通过 ssh)连接 jupyter python
问题描述
我在连接到我在远程计算机上运行的 jupyter 时遇到问题。我已经使用 ssl 配置了 jupyter,如下面的文档所示:
https://jupyter-notebook.readthedocs.io/en/latest/public_server.html#hashed-pw
然后我使用命令在远程机器上运行 jupyter:jupyter notebook
如教程中所示。当它运行时,我通过运行命令在另一个终端中建立隧道:
ssh -N -f -L 8889:127.0.0.1:8881 user_name@hostname.com
当然,jupyter 正在运行port 8881
。当我在本地计算机上打开浏览器并尝试打开页面时:
localhost:8889
我收到连接已重置的错误,并且在命令行中 ssh 返回以下错误:
channel 2: open failed: connect failed: Connection refused
谁能帮我?我整天都在寻找答案,但仍然无法解决。
解决方案
问题是,在我的情况下,jupyter 正在本地主机上运行。在我的服务器远程服务器上,我无法访问远程本地主机,因此解决方案非常简单 - 我在指定的 ip = 0.0.0.0 上运行 jupyter
jupyter notebook --no-browser --port=8881 --ip=0.0.0.0
推荐阅读
- go - 无法在多重赋值中将字符串赋值给 __type__(类型 __type__ )
- regex - 捕获每组的所有文本
- python - 如何准备数据并进行自编码器的训练?
- php - 数组中的表单在 if 语句后不显示按钮
- google-chrome-extension - 切换到 v3 后从 Chrome 扩展程序进行 Google 身份验证
- linux - Apache将所有路径映射到根目录而不重定向
- firebase - GCP 上的身份验证服务,在欧洲提供数据存储选项
- machine-learning - 树与回归算法 - 哪个更适合具有主要分类特征的模型?
- node.js - 如何在给定一组值参数的情况下触发并发 lambda 执行?
- python - Python Asyncio TimeoutError (tasks.loop)