近期通过ssh链接远程服务器,打开jupyter lab时需要输入密码,先运行了以下指令:
cd ~/.jupyter
ls
vi XXX(配置文件)
复制配置文件中c.ServerApp.password到网页的pwd中(连token都没有,只有pwd),提示invalid credentials
- 在命令行输入
jupyter notebook password
修改密码,再次输入,还是invalid credentials。 - 输入
ps -ax | grep jupyter-lab
查找与 JupyterLab 关联的特定进程 ID (PID)并kill 掉。 nohup jupyter-lab --allow-root > jupyter.log 2>&1 &
,在后台启动 JupyterLab 服务器并将标准输出和错误流重定向到名为“jupyter.log” 的日志文件。重启jupyter lab,输入密码,成功登入。
至此问题解决!
PS:另外在解决这个问题时,还用到一种方法,将前述jupyter lab的配置文件中c.ServerApp.password=“XXX”
中XXX
删掉,即改为c.ServerApp.password=“”
,按理说可以跳过输密码的界面直接登入,但是刷新网页依旧是老样子(跳转要求输入pwd),因此推测该方法可能没有奏效。