问题
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