kickstart 最小化安装centos8
admin
2023-02-25 20:00:04
0

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

# Kickstart file automatically generated by anaconda.

#version=RHEL8
#use text install
text

# Use NFS installation media
nfs --server=192.168.1.253 --dir=/ct80_64

# System language
lang en_US.UTF-8

# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'

#add root password
rootpw  --iscrypted xxxxxxxxxxx

# System authorization information
authconfig --enableshadow --enablemd5

# SELinux configuration
selinux --disabled

firstboot --disable

# Do not configure the X Window System
skipx

# firewall configuration
firewall --disabled

# System services
services --enabled="chronyd"

# System timezone
timezone Asia/Shanghai

#修改这样可以定义网卡名称为ethx
# System bootloader configuration
bootloader --location=mbr --append="net.ifnames=0 biosdevname=0 rhgb quiet"

# Partition clearing information
clearpart --all --initlabel

# create 1MB biosboot type partition, centos7 and centos8 .
part biosboot --fstype=biosboot --size=1

# Disk partitioning information
part /boot --fstype=xfs --size=300

part pv.122 --fstype="lvmpv" --grow
volgroup VolGroup00  --pesize=16384 pv.122
logvol / --fstype="xfs" --size=10000 --name=LogVol00 --vgname=VolGroup00

%packages
@Base
@Core
@development
@network-tools
gettext-devel
sysstat
zlib-devel
psmisc
%end

%post --erroronfail --log=/root/ks-post.log

echo "nameserver 114.114.114.114">/etc/resolv.conf
echo "nameserver 202.106.46.151">>/etc/resolv.conf
echo "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 - $basearch
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
EOF

date >> /root/install.log 
echo "network configing " >> /data/install.log

cat >/etc/sysconfig/network-scripts/ifcfg-eth0 <>/etc/NetworkManager/NetworkManager.conf

cat >> /etc/sysctl.conf <> /etc/rc.local
echo "ulimit -n 655350" >> /etc/rc.local
echo "ulimit -s 102400" >> /etc/rc.local
echo "ulimit -n 655350" >> /etc/profile

echo "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 installation
reboot

相关内容

热门资讯

中纪委连打三“虎” 今天(25日),中央纪委国家监委网站连发三份通报。肖杰被开除党籍经中共中央批准,中央纪委国家监委对海...
扎根硬核场景,璇玑动力以全栈自... 2026 世界人工智能大会落地三地四馆,具身智能成为全场核心主线,超 200 家企业同台竞技。展区内...
靠谱大容量TF卡推荐:三星T7... 三星原厂 · 全能微存储新基准 当平板扩容需求激增、Switch游戏掌机需加载多款3A游戏、航拍无人...
买不起大疆、影石的年轻人,排队... 文 | 表外表里 ,作者 | 陈梓洁,编辑 | 杨静、曹宾玲 “一台机器,旺季月入1500。” 去...
美国众议员当街打掉拍摄人员的手... 近日,美国KCCI电视台爆出的一段视频显示,美国众议员扎克·纳恩在街道上与跟踪拍摄人员发生口角,并动...
今天上凯道人数成关键!媒体人示... 海峡导报综合报道 台湾中联油脂致癌油风暴继续延烧,国民党今天(25日)在凯道举办“我是人、我反毒台”...
谷歌公布1500万次AI交互,... 导读:谷歌分析1500万次去标识化AI交互后发现,在一个典型职业中,AI大约可参与21%的任务,但完...
空调水管不出水不制冷 原因可能是空调缺氟或是氟利昂泄漏,可以修补泄漏点,添加适量的氟;原因可能是空调的功率不够,可以更换与...
洗衣机不出水怎样修理拆装 如果您的洗衣机出现不出水的问题,也许是因为以下几个原因:1. 水龙头未开启:在洗衣机不出水的情况下,...
原创 三... 随着REDMI K100系列两杯(Pro/ProMax)的入网,以及一款小米神秘新机,小米在8月份的...