惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
Spread Privacy
Spread Privacy
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
SecWiki News
SecWiki News
腾讯CDC
P
Privacy International News Feed
Webroot Blog
Webroot Blog
J
Java Code Geeks
爱范儿
爱范儿
A
About on SuperTechFans
S
Secure Thoughts
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
D
DataBreaches.Net
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Latest
Security Latest
Forbes - Security
Forbes - Security
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threatpost
量子位
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
S
Security @ Cisco Blogs
T
The Exploit Database - CXSecurity.com
Help Net Security
Help Net Security
V
Visual Studio Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 聂微东
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs

MX – 百品博客

百品电台:自动提供反代的电台App - 百品博客 百品导航:轻量客制化导航首页 - 百品博客 OMSI2香港地圖下載整合 - 百品博客 AI部署实践:Colab部署AI模型进行Fine Tuning - 百品博客 都市天际线2模组:香港路牌包[WE] - 百品博客 一些闲暇的感受 - 百品博客 美式高速公路路牌制作器 - 百品博客 也谈山西大同订婚强奸案 - 百品博客 换一个新Logo - 百品博客
宝塔面板Jupyterhub插件bug修复 - 百品博客
MX文章作者勇敢打破裂缝,阳光就会洒满其中。 · 2025-05-04 · via MX – 百品博客

概述

使用宝塔面板中自带的Jupyterhub 1.0.1 插件包安装以后,无论使用什么账号密码登录,一律显示“Invaild username or password”。

https://baipin.pw/wp-content/uploads/2025/05/image.png

解决方案

已经发现有用户在宝塔面板的论坛反应问题,但是发帖时间是2024年12月,现在已经是2025年5月,bug仍未修复。而这个bug已经是让整个插件完全无法使用的状态,所以官方对这个插件的维护可以说几乎没有吧。

修复这个问题也很简单,打开安装目录,找到 jupyterhub_config.py 文件,可以看到原始文件是这样的:

c = get_config()


# 管理员用户列表
c.Authenticator.admin_users = {'jupyterhub'}

#c.Authenticator.admin_users = {'root'}  # 管理员用户
#c.DummyAuthenticator.password = "123"  # 初始密码设置

# 使用 PAMAuthenticator 作为身份验证类
c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator'

# 允许自动创建系统用户
c.LocalAuthenticator.create_system_users = True


 
# 设置每个用户的 book类型 和 工作目录(创建.ipynb文件自动保存的地方)
c.Spawner.notebook_dir = '~'
c.Spawner.default_url = '/lab'
c.Spawner.args = ['--allow-root'] 

可以看到这个配置界面把 DummyAuthenticator 的配置注释掉了,并且使用PAMAuthenticator作为验证方法。因此我们使用 DummyAuthenticator 作为验证方法,并且删除注释。

c = get_config()


# 管理员用户列表
c.Authenticator.admin_users = {'jupyterhub'}

c.Authenticator.admin_users = {'root'}  # 管理员用户
c.DummyAuthenticator.password = "123"  # 初始密码设置

# 使用 DummyAuthenticator 作为身份验证类
c.JupyterHub.authenticator_class = 'jupyterhub.auth.DummyAuthenticator'

# 允许自动创建系统用户
c.LocalAuthenticator.create_system_users = True


 
# 设置每个用户的 book类型 和 工作目录(创建.ipynb文件自动保存的地方)
c.Spawner.notebook_dir = '~'
c.Spawner.default_url = '/lab'
c.Spawner.args = ['--allow-root'] 

然后使用root用户名和123(密码)登录Jupyterhub,至此大功告成。(虽然不是最好的方法,但也是目前摸索到的唯一有效方法)

修改用户名和密码

登录Jupyterhub,点击File--Hub Control Panel来对用户名进行修改。