#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'
# 系統語言
lang en_US.UTF-8
# 禁用防火墻
firewall --disabled
# 網絡信息
network --bootproto=dhcp --ipv6=auto --activate
network --hostname=localhost.localdomain
# Root 密碼 123456
rootpw --iscrypted $1$6WVLEBH1$k4/Geot6xK66xr4ffGSZI/
# 系統服務
services --enabled="chronyd"
# 系統時區
timezone Asia/Shanghai --isUtc
# 系統引導配置
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
# 分區清除信息
clearpart --all --initlabel --drives=sda
# 磁盤分區信息
part / --fstype="ext4" --ondisk=sda --grow
# 安裝完自動重啟
reboot --eject
#預安裝的包
%packages
@^minimal
@core
%end
# 安裝完執行
%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 自動應答文件
最后編輯于 :
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
推薦閱讀更多精彩內容
- 一、前言 最近學習了如何使用kickstart文件自動安裝系統,在研究了兩天后終于成功將系統安裝了起來,本文記錄我...
- Cobbler簡介 使用PXE批量部署時,有一個缺陷,即只能安裝單一的操作系統(同一個版本,僅用一個kicksta...
- 安裝 確保文件結構如下: 創建~/.vimrc,確保其中內容如下: [root@disconf pydiction...
- 第一步當然是安裝各種需要的軟件包 完成后你應該會在/etc下發現auto.cifs auto.master或者au...