Centos 7 自动应答文件

#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 <

你可能感兴趣的:(Centos 7 自动应答文件)