Shell Install Linux
Jul 10, 2017 · 2 min read
以Centos最小安裝
#!/bin/bash
yum -y install #套件
yum -y update
sed -e ‘s/SELINUX=enforcing /SELINUX=disabled/i’ /etc/SELINUX #關閉SELinux
systemctl stop firewall.service
systemctl disabled firewall.service #關閉firewallrpm — import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum -y install epel-releaseyum -y install ntpdate #安裝ntpecho ‘0 * * * * root (/usr/sbin/ntpdate time.stdtime.gov.tw && /sbin/hwclock -w) &> /dev/null ‘ >> /etc/crontabsystemctl restart crond.serviceyum -y install fail2ban fail2ban-systemd # 安裝 fail2ban
ystemctl stop firewalld.service
systemctl mask firewalld.service
systemctl disable firewalld.service
systemctl stop firewalld.servicesed -i ‘s/enabled = false /enabled = true/i’ /etc/fail2ban/jail.local
目前還沒有全部寫完,這樣的寫法我不知道可否行得通要做測試才知道
如果可以就可以快速安裝一台Linux的機器。

