Jupyter notebook password not working from SSH

限于喜欢 提交于 2019-12-10 17:27:22

问题


Trying to connect to a Jupyter Notebook through 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

Set the jupyter password:

jupyter notebook password
# set it to something

Then I run jupyter:

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

Then I open my localhost:4000 and get the jupyter login page.

However, putting in the password here only gives 'Invalid credentials'.

Why would this be?


回答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.

Case 1: Run browser on the server

  • both localhost and 127.0.0.1 accept my password

Case 2: SSH to server 1

  • localhost accepts my password
  • 127.0.0.1 rejects my password

Case 3: SSH to server 2

  • localhost rejects my password
  • 127.0.0.1 accepts my password

If you access the server using 127.0.0.1:4000, does that work?



来源:https://stackoverflow.com/questions/52486697/jupyter-notebook-password-not-working-from-ssh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!