Jupyter笔记本电脑密码无法通过SSH使用 [英] Jupyter notebook password not working from SSH
问题描述
尝试通过SSH连接到Jupyter Notebook.
Trying to connect to a Jupyter Notebook through SSH.
我有一个脚本可以通过SSH登录到计算机:
I have a script which logs in to machine through SSH:
#!/usr/bin/expect -f
spawn ssh -L localhost:4000:localhost:8889 user@sshaddress.com
expect "assword:"
send "password\r"
interact
设置jupyter密码:
Set the jupyter password:
jupyter notebook password
# set it to something
然后我运行jupyter:
Then I run jupyter:
jupyter notebook --no-browser --port=8889
然后我打开我的localhost:4000
并获得jupyter登录页面.
Then I open my localhost:4000
and get the jupyter login page.
但是,在此处输入密码只会给出无效的凭据".
However, putting in the password here only gives 'Invalid credentials'.
为什么会这样?
推荐答案
我有一个类似的问题,但是我不确定是否相同.我有两台运行笔记本的服务器,这些笔记本通过SSH隧道访问.我的密码是否有效取决于我在URL中使用localhost
还是127.0.0.1
.我不知道为什么.
I have a similar problem, but I'm not sure if it's identical. I have two servers where I run notebooks which I access through SSH tunneling. Whether or not my password works depends on whether I use localhost
or 127.0.0.1
in the URL. I cannot figure out why.
情况1:在服务器上运行浏览器
Case 1: Run browser on the server
- localhost和127.0.0.1都接受我的密码
案例2:SSH到服务器1
Case 2: SSH to server 1
- 本地主机接受我的密码
- 127.0.0.1拒绝我的密码
案例3:SSH到服务器2
Case 3: SSH to server 2
- 本地主机拒绝我的密码
- 127.0.0.1接受我的密码
如果您使用127.0.0.1:4000访问服务器,那行得通吗?
If you access the server using 127.0.0.1:4000, does that work?
这篇关于Jupyter笔记本电脑密码无法通过SSH使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!