Skip to content
Permalink
39db146717
Go to file
 
 
Cannot retrieve contributors at this time
71 lines (55 sloc) 1.72 KB
install
cdrom
lang en_US.UTF-8
keyboard us
timezone UTC
network --onboot yes --bootproto dhcp
bootloader --location=mbr
repo --name=base --baseurl=http://mirror.steadfast.net/centos/7/os/x86_64/
url --url=http://mirror.steadfast.net/centos/7/os/x86_64/
logging --level=debug
firewall --enabled --ssh
services --enabled=NetworkManager,sshd
eula --agreed
text
skipx
zerombr
clearpart --all
autopart --type=plain --fstype=xfs
firstboot --disabled
authconfig --useshadow --passalgo=sha512
rootpw --lock --plaintext "$(openssl rand -base64 32)"
user --name centos --groups wheel,adm,systemd-journal --uid 1000 --gid 1000 --plaintext --password centos
reboot
%packages --nobase --ignoremissing
@core
@development Tools
openssh-clients
sudo
openssl-devel
readline-devel
zlib-devel
kernel-headers
kernel-devel
net-tools
vim
wget
curl
rsync
sudo
%end
%post --log=/var/log/ks.post.log
systemctl disable avahi-daemon.service
systemctl disable kdump.service
sed -i -r 's@^#?PermitRootLogin.*$@PermitRootLogin no@' /etc/ssh/sshd_config
sed -i -r "s@^.*requiretty@#Defaults requiretty@" /etc/sudoers
echo "centos ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/centos
chmod 440 /etc/sudoers.d/centos
mkdir --mode=700 /home/centos/.ssh
cat << EOF > /home/centos/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0F2Y68rs0DPofa9ZCJYxx9FG6Lzk+szeI6/c2P4C3yNWy1QvPDfUzFXGgPnb/O0EkI6s4qQ8Nt16GAfwdC4xvrZG5lpn++vBwEb4CxpF+23TsmQCi+DJjNgH4+XfBlGqplcjxJuMOrKrOO+wGuc7yetJ32b2wMNJUv0ijWpCiFp8fhs0a5+q4tq+6Q7LBlaIFTvjTP+YKh7JxAzG492m8TkbVQGnPpnTFI5OF5Q6t0Yqn87RZvVRvuU+jXXxSH7EHWbSpkXveElCC53o3MtunwTYtSkGDkAIF92Iw7eEX9d6hVsO4OXZPIgZn0oWNQQh8yyDYHB+4XQa1mQD8TS8f centos@centos.local
EOF
chown -R centos /home/centos/.ssh
yum -y update
yum -y clean all
%end
You can’t perform that action at this time.