在 Debian 上使用 Cobbler 时,“设密码”通常分为几种场景。下面按常见需求分别说明。
Cobbler 早期版本提供 Web 管理界面,用户一般是 cobbler。
如果是用 authn_configfile 方式:
htdigest /etc/cobbler/users.digest "Cobbler" cobbler
按提示输入新密码。
文件位置可能不同,常见:
/etc/cobbler/users.digest/etc/cobbler/users.settings
编辑:
/etc/cobbler/modules.conf
确保:
[authentication]
module = authn_configfile
重启服务:
systemctl restart cobblerd
Cobbler 命令行需要连接 XMLRPC,默认有 default_password_crypted。
openssl passwd -1
或
python3 -c 'import crypt; print(crypt.crypt("你的密码", crypt.mksalt(crypt.METHOD_SHA512)))'
编辑:
/etc/cobbler/settings.yaml
设置:
default_password_crypted: "$1$xxx$xxxxxxxxxxxx"
然后:
cobbler sync
这是装机后系统的 root 密码。
cobbler system edit --name=node01 \
--kernel-options="net.ifnames=0 biosdevname=0" \
--password-crypted='$6$xxxx'
在 .ks 文件里:
rootpw --iscrypted $6$xxxxxxxxxxxx
生成方式:
python3 -c 'import crypt; print(crypt.crypt("密码", crypt.mksalt(crypt.METHOD_SHA512)))'
PXE 启动本身没有密码机制,如果要限制:
systemctl restart cobblerd
systemctl restart apache2 # 若使用 cobbler-web
cobbler sync
| 场景 | 配置位置 |
|---|---|
| Web 登录 | users.digest / modules.conf |
| CLI 密码 | settings.yaml |
| 装机系统 root | kickstart / system |
| PXE 启动 | 无密码 |
如果你能说明具体是哪一种密码(Web?root?CLI?),我可以给你更精确的命令。