mirror of
https://github.com/bin456789/reinstall.git
synced 2025-12-10 07:28:56 +08:00
10
debian.cfg
10
debian.cfg
@ -26,6 +26,7 @@ d-i mirror/country string manual
|
||||
# B.4.5. 帐号设置
|
||||
d-i passwd/make-user boolean false
|
||||
# 单纯为了跳过设置,实际上是在 partman/early_command 里设置密码,preseed/early_command 无法设置密码
|
||||
# 注意如果用 ssh key 后面还要删除密码
|
||||
d-i passwd/root-password password ''
|
||||
d-i passwd/root-password-again password ''
|
||||
# kali 需要下面这行,否则会提示输入用户名
|
||||
@ -172,8 +173,13 @@ d-i preseed/late_command string true; \
|
||||
|
||||
in-target systemctl enable ssh; \
|
||||
|
||||
echo "PermitRootLogin yes" >/target/etc/ssh/sshd_config.d/01-permitrootlogin.conf || \
|
||||
echo "PermitRootLogin yes" >>/target/etc/ssh/sshd_config; \
|
||||
if [ -s /configs/ssh_keys ]; then \
|
||||
(umask 077; mkdir -p /target/root/.ssh; cat /configs/ssh_keys >/target/root/.ssh/authorized_keys); \
|
||||
in-target passwd -d root; \
|
||||
else \
|
||||
echo "PermitRootLogin yes" >/target/etc/ssh/sshd_config.d/01-permitrootlogin.conf || \
|
||||
echo "PermitRootLogin yes" >>/target/etc/ssh/sshd_config; \
|
||||
fi; \
|
||||
|
||||
if [ -n "$ssh_port" ] && ! [ "$ssh_port" = 22 ]; then \
|
||||
echo "Port $ssh_port" >/target/etc/ssh/sshd_config.d/01-change-ssh-port.conf || \
|
||||
|
||||
Reference in New Issue
Block a user