【问题标题】:Jupyter notebook password not working from SSHJupyter 笔记本密码在 SSH 中不起作用
【发布时间】:2019-02-28 09:36:03
【问题描述】:

尝试通过 SSH 连接到 Jupyter Notebook。

我有一个通过 SSH 登录机器的脚本:

#!/usr/bin/expect -f
spawn ssh -L localhost:4000:localhost:8889 user@sshaddress.com
expect "assword:"
send "password\r"
interact

设置jupyter密码:

jupyter notebook password
# set it to something

然后我运行 jupyter:

jupyter notebook --no-browser --port=8889

然后我打开我的localhost:4000 并获得 jupyter 登录页面。

但是,在此处输入密码只会给出“无效凭据”。

为什么会这样?

【问题讨论】:

  • 应该expect "assword:"expect "password:"
  • 没有。见here。此外,这与仅用于使用 SSH 登录服务器的 Jupyter 内容无关。

标签: python ssh jupyter-notebook


【解决方案1】:

我有类似的问题,但我不确定它是否相同。我有两台服务器,我在其中运行通过 SSH 隧道访问的笔记本。我的密码是否有效取决于我在 URL 中使用的是localhost 还是127.0.0.1。我不知道为什么。

案例一:在服务器上运行浏览器

  • localhost 和 127.0.0.1 都接受我的密码

案例 2:SSH 到服务器 1

  • localhost 接受我的密码
  • 127.0.0.1 拒绝了我的密码

案例 3:SSH 到服务器 2

  • localhost 拒绝我的密码
  • 127.0.0.1 接受我的密码

如果你使用 127.0.0.1:4000 访问服务器,这样行吗?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-22
    • 2020-03-25
    • 1970-01-01
    • 1970-01-01
    • 2020-07-20
    • 1970-01-01
    相关资源
    最近更新 更多