什么是在谷歌的数据处理上创建的Jupyter的默认密码

时间:2016-12-13 09:29:45

标签: google-cloud-platform jupyter-notebook google-cloud-dataproc

我使用链接中的步骤设置数据处理

https://cloud.google.com/dataproc/docs/tutorials/jupyter-notebook

但我的jyputer一直要求输入密码

enter image description here

我没有设置任何密码。

我尝试了无效的谷歌帐户密码

我跑了../root$ sudo grep -ir password 并得到以下,以确认没有设置密码

.jupyter/jupyter_notebook_config.py:## Hashed password to use for web authentication.
.jupyter/jupyter_notebook_config.py:#  The string should be of the form type:salt:hashed-password.
.jupyter/jupyter_notebook_config.py:#c.NotebookApp.password = u''
.jupyter/jupyter_notebook_config.py:#  Only used when no password is enabled.
.local/share/jupyter/runtime/nbserver-3668.json:  "password": false, 

2 个答案:

答案 0 :(得分:4)

由于初始化操作仅使用conda install jupyter从最新安装,这似乎是由最近的上游更改引起的,特别是将notebook组件从4.2.3升级到{{1}导致token-based auth to be turned on by default。我几周前使用开箱即用的初始化操作部署的最近一个集群没有您所看到的相同登录; init操作的设计是让Google Compute Engine防火墙成为您的防御层,SSH隧道是您的安全连接,而不是依赖于来自不同Hadoop / Spark工具和Web UI的各种第三方auth实现。 / p>

解决方案是在setup-jupyter-kernel.sh添加一行:

4.3.0

完全禁用jupyter端身份验证并恢复几周前的行为。请注意,如果您想自己执行此操作,则必须使用echo "c.NotebookApp.token = u''" >> ~/.jupyter/jupyter_notebook_config.py 中的INIT_ACTIONS_REPOINIT_ACTIONS_BRANCH设置,这可能需要一些时间来适应,如果您尚未自定义它已经。我们将尝试尽快推出修复程序,一旦完成,您应该能够使用开箱即用的初始化操作,而不会再次导致登录屏幕。

如果您已经有一个集群在运行,您可以通过在SSH进入主服务器之后以root身份手动运行,为您的jupyter服务器禁用auth:

jupyter.sh

或者,如果您确实希望保留新的默认令牌授权方法,那么jupyter服务器实际上会将生成的令牌记录到sudo su killall -9 jupyter-notebook echo "c.NotebookApp.token = u''" >> ~/.jupyter/jupyter_notebook_config.py /dataproc-initialization-actions/jupyter/internal/launch-jupyter-kernel.sh ;找一条陈述/var/log/jupyter_notebook.log的线;该标记字符串可以插入密码字段或URL参数中,如图所示。

编辑:修复程序有now been committed到Dataproc的init操作存储库并同步到The Jupyter Notebook is running at: http://[all ip addresses on your system]:8123/?token=[some-token-string-here]。开箱即用的部署在Jupyter UI中没有额外的登录页面时再次工作。

如果您想要指定Jupyter允许在gs://dataproc-initialization-actions字段中使用密钥password的令牌,还添加了新的元数据选项。仅当您想要一个请求指定令牌的登录页面时才使用它(如果您只想要没有登录页面的旧行为,则不需要元数据键):

JUPYTER_AUTH_TOKEN

然后您的登录密码为gcloud dataproc clusters create \ --initialization-actions gs://dataproc-initialization-actions/jupyter/jupyter.sh \ --metadata JUPYTER_AUTH_TOKEN=foobarbaz

答案 1 :(得分:0)

当您不设置任何密码时,您可以使用安装它的服务器凭据登录。