#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# 鍵盤布局
keyboard --vckeymap=us --xlayouts='us'
# 系統(tǒng)語言
lang en_US.UTF-8
# 禁用防火墻
firewall --disabled
# 網(wǎng)絡(luò)信息
network --bootproto=dhcp --ipv6=auto --activate
network --hostname=localhost.localdomain
# Root 密碼 123456
rootpw --iscrypted $1$6WVLEBH1$k4/Geot6xK66xr4ffGSZI/
# 系統(tǒng)服務(wù)
services --enabled="chronyd"
# 系統(tǒng)時(shí)區(qū)
timezone Asia/Shanghai --isUtc
# 系統(tǒng)引導(dǎo)配置
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
# 分區(qū)清除信息
clearpart --all --initlabel --drives=sda
# 磁盤分區(qū)信息
part / --fstype="ext4" --ondisk=sda --grow
# 安裝完自動(dòng)重啟
reboot --eject
#預(yù)安裝的包
%packages
@^minimal
@core
%end
# 安裝完執(zhí)行
%post
echo -ne "
root soft nofile 65535
root hard nofile 65535
* soft nofile 65535
* hard nofile 65535
" >>/etc/security/limits.conf
#set sysctl
true > /etc/sysctl.conf
cat >> /etc/sysctl.conf << EOF
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
vm.swappiness = 0
net.ipv4.neigh.default.gc_stale_time=120
# see details in https://help.aliyun.com/knowledge_detail/39428.html
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_announce=2
net.ipv4.conf.all.arp_announce=2
# see details in https://help.aliyun.com/knowledge_detail/41334.html
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_synack_retries = 2
fs.file-max=65535kernel.sysrq = 1
kernel.sysrq = 1
EOF
/sbin/sysctl -p
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
cat >> /etc/yum.repos.d/CentOS-Base.repo <<EOF
[base]
name=CentOS-\$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/os/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-\$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/updates/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-\$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/extras/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-\$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/centosplus/\$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
EOF
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
Centos 7 自動(dòng)應(yīng)答文件
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
相關(guān)閱讀更多精彩內(nèi)容
- 一、前言 最近學(xué)習(xí)了如何使用kickstart文件自動(dòng)安裝系統(tǒng),在研究了兩天后終于成功將系統(tǒng)安裝了起來,本文記錄我...
- Cobbler簡介 使用PXE批量部署時(shí),有一個(gè)缺陷,即只能安裝單一的操作系統(tǒng)(同一個(gè)版本,僅用一個(gè)kicksta...
- 安裝 確保文件結(jié)構(gòu)如下: 創(chuàng)建~/.vimrc,確保其中內(nèi)容如下: [root@disconf pydiction...
- 第一步當(dāng)然是安裝各種需要的軟件包 完成后你應(yīng)該會(huì)在/etc下發(fā)現(xiàn)auto.cifs auto.master或者au...