Shell Install Linux

AllenLin
AllenLin
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 #關閉firewall
rpm — import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum -y install epel-release
yum -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.service
sed -i ‘s/enabled = false /enabled = true/i’ /etc/fail2ban/jail.local

目前還沒有全部寫完,這樣的寫法我不知道可否行得通要做測試才知道

如果可以就可以快速安裝一台Linux的機器。

origino

A Technical Organization in Taiwan

    AllenLin

    Written by

    AllenLin

    origino

    origino

    A Technical Organization in Taiwan

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade