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

推荐订阅源

T
The Blog of Author Tim Ferriss
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Palo Alto Networks Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Schneier on Security
Engineering at Meta
Engineering at Meta
I
InfoQ
L
LangChain Blog
Cyberwarzone
Cyberwarzone
T
Tenable Blog
WordPress大学
WordPress大学
P
Privacy & Cybersecurity Law Blog
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Jina AI
Jina AI
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
Know Your Adversary
Know Your Adversary
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Last Watchdog
The Last Watchdog
Last Week in AI
Last Week in AI
Cloudbric
Cloudbric
S
SegmentFault 最新的问题
爱范儿
爱范儿
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 叶小钗
AI
AI
T
Tor Project blog
I
Intezer
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
N
News and Events Feed by Topic
Latest news
Latest news
S
Security Affairs
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog RSS Feed
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
S
Securelist

百品博客

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

概述

使用宝塔面板中自带的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来对用户名进行修改。