forked from wgetnz/reinstall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredhat.cfg
53 lines (45 loc) · 1.52 KB
/
redhat.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# shellcheck disable=SC2148
# 设置
keyboard --vckeymap=us --xlayouts='us'
lang en_US.UTF-8
timezone Asia/Shanghai --utc
rootpw --plaintext 123@@@
text
reboot
%include /tmp/include-url-command
# 分区
%include /tmp/include-disk-only-use
%include /tmp/include-bootloader
clearpart --all --initlabel
reqpart # 如果需要,自动创建 efi 或 biosboot 分区
part / --fstype=xfs --grow
# 软件
%packages --ignoremissing # el9 minimal.iso fedora Server repo/iso 没有 tuned
@^Minimal Install
%include /tmp/include-packages-for-resize
%include /tmp/exclude-packages-for-vm
%end
# 禁用防火墙
# firewall --disabled
# 禁用 selinux
selinux --disabled
# 禁用 kdump
%addon com_redhat_kdump --disable
%end
##############################################
%pre
# 预安装脚本略,未作更改
##############################################
%post
# el9/fedora的sshd默认不允许root密码登录,需手动开启
# rootpw --allow-ssh 9.1 以上才支持
distro=$(awk -F: '{ print $3 }' </etc/system-release-cpe)
releasever=$(awk -F: '{ print $5 }' </etc/system-release-cpe)
if [ "$releasever" = "9" ] || [ "$distro" = "fedoraproject" ]; then
echo "PermitRootLogin prohibit-password" >/etc/ssh/sshd_config.d/01-permitrootlogin.conf
echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBEMbxeShxjM96D1ORCjSN4adloe4uhMKPfljlDo9SoP max@Jking' >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
fi
# 分步安装的系统,要将最后一个分区(installer)合并到系统分区
# 后续脚本略,未作更改
%end