Ubuntu下没有/etc/pam.d/system-auth

这篇博客探讨了CentOS、Fedora和RHEL系统中预装的cracklib PAM模块,该模块增强了密码安全性。然而,Ubuntu系统并未默认安装此模块,因此在寻找相关配置文件时会遇到困难。文章将阐述如何在Ubuntu中手动安装和配置cracklib,以实现与Red Hat系系统类似的密码检查功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

CentOS、Fedora、RHEL 系统已经默认安装了 cracklib PAM 模块,cracklib 能提供额外的密码检查能力。而Ubuntu没有安装,所以找不到相关的配置文件。

Ubuntu 22.04系统上设置一个多用户JupyterHub环境需要几个步骤: 1. **安装依赖**: - 首先更新系统并安装必要的包: ``` sudo apt update sudo apt install python3-pip git pip3 install jupyterhub tornado ``` 2. **下载并安装JupyterHub**: ``` git clone https://github.com/jupyterhub/jupyterhub.git cd jupyterhub make sudo make install ``` 3. **配置JupyterHub**: 创建`jupyterhub_config.py`文件,并按照以下结构添加基本配置: ```python c = get_config() c.JupyterHub.ip = '0.0.0.0' c.JupyterHub.port = 8000 c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator' c.Authenticator.create_system_users = True ``` 这里设置了JupyterHub监听所有IP地址和端口8000,使用PAM认证创建系统用户。 4. **启用PAM认证**: - 安装PAM模块,例如 `pam-auth-manager` 或者 `libpam-python3-jwt`,具体取决于你的需求。 - 编辑`/etc/pam.d/jupyterhub` 文件,将认证方式改为PAM认证。 5. **创建启动脚本**: 使用`sudo nano /etc/systemd/system/jupyterhub.service`编辑启动脚本,确保指向你的`jupyterhub`目录,然后运行: ```bash [Unit] Description=JupyterHub Server After=network.target [Service] ExecStart=/usr/local/bin/jupyterhub --config=/path/to/jupyterhub_config.py Restart=always User=jovyan # 替换为你的JupyterHub用户,如果默认的话通常是`jovyan` Group=jupyterhub [Install] WantedBy=multi-user.target ``` 6. **启动服务和设置开机自启**: - 启动JupyterHub服务: ``` sudo systemctl start jupyterhub ``` - 设置自动开机启动: ``` sudo systemctl enable jupyterhub ``` 7. **测试和访问**: 测试JupyterHub是否正常工作,通过浏览器访问`http://your-server-ip:8000`。管理员应该能够创建新用户,并登录查看各自的工作区。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值