千家信息网

kickstart 最小化安装centos8

发表于:2025-02-01 作者:千家信息网编辑
千家信息网最后更新 2025年02月01日,centos8 发布尝鲜,先改个ks 安装# Kickstart file automatically generated by anaconda.#version=RHEL8#use text in
千家信息网最后更新 2025年02月01日kickstart 最小化安装centos8

centos8 发布尝鲜,先改个ks 安装

# Kickstart file automatically generated by anaconda.#version=RHEL8#use text installtext# Use NFS installation medianfs --server=192.168.1.253 --dir=/ct80_64# System languagelang en_US.UTF-8# Keyboard layoutskeyboard --vckeymap=us --xlayouts='us'#add root passwordrootpw  --iscrypted xxxxxxxxxxx# System authorization informationauthconfig --enableshadow --enablemd5# SELinux configurationselinux --disabledfirstboot --disable# Do not configure the X Window Systemskipx# firewall configurationfirewall --disabled# System servicesservices --enabled="chronyd"# System timezonetimezone Asia/Shanghai#修改这样可以定义网卡名称为ethx# System bootloader configurationbootloader --location=mbr --append="net.ifnames=0 biosdevname=0 rhgb quiet"# Partition clearing informationclearpart --all --initlabel# create 1MB biosboot type partition, centos7 and centos8 .part biosboot --fstype=biosboot --size=1# Disk partitioning informationpart /boot --fstype=xfs --size=300part pv.122 --fstype="lvmpv" --growvolgroup VolGroup00  --pesize=16384 pv.122logvol / --fstype="xfs" --size=10000 --name=LogVol00 --vgname=VolGroup00%packages@Base@Core@development@network-toolsgettext-develsysstatzlib-develpsmisc%end%post --erroronfail --log=/root/ks-post.logecho "nameserver 114.114.114.114">/etc/resolv.confecho "nameserver 202.106.46.151">>/etc/resolv.confecho "search localdomain">>/etc/resolv.conf#安装docker repo ############docker repo ##########sudo tee /etc/yum.repos.d/docker-ce.repo <<-'EOF'[docker-ce-stable]name=Docker CE Stable - $basearchbaseurl=https://download.docker.com/linux/centos/7/$basearch/stableenabled=1gpgcheck=1gpgkey=https://download.docker.com/linux/centos/gpgEOFdate >> /root/install.log echo "network configing " >> /data/install.logcat >/etc/sysconfig/network-scripts/ifcfg-eth0 <>/etc/NetworkManager/NetworkManager.confcat >> /etc/sysctl.conf <> /etc/rc.localecho "ulimit -n 655350" >> /etc/rc.localecho "ulimit -s 102400" >> /etc/rc.localecho "ulimit -n 655350" >> /etc/profileecho "root       soft    nproc     unlimited*          soft    nproc      655350*          hard    nproc      655350*          soft    nofile     655350*          hard    nofile     655350" >/etc/security/limits.d/20-nproc.conf# Do not update kerner sed -i '/\[main\]'/a\exclude=kernel\* /etc/yum.conf#这里可以添加用户key#禁用密码认证sed  -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config# Reboot after installationreboot
0