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

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

宝塔面板 – 百品博客

暂无文章

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