CentOS7 Base Install

Linux Base Package

echo "PS1='\033[1;33m\D{%F} \t \033[1;33m[\u@\H] \033[1;35m\w\033[0;0m\n#'" >> /root/.bashrc

. .bashrc

rm -f anaconda-ks.cfg

yum -y install epel-release

# For Physical Server
yum -y install htop dmidecode wget screen net-tools net-snmp perl \
  perl-libwww-perl vim sysstat iftop zip unzip lsof nc bash-completion \
bind-utils nfs-utils telnet bzip2

# for Centos7
yum -y install yum-utils ntp curl lsof bridge-utils pciutils \ git ipmi qemu-guest-agent deltarpm
#for Centos8
yum -y install chrony

systemctl stop firewalld

systemctl disable firewalld

yum -y remove firewalld*

systemctl stop NetworkManager ; systemctl disable NetworkManager yum -y erase NetworkManager ; systemctl stop postfix ;yum -y remove postfix systemctl stop chronyd ; yum -y remove chrony
chmod +x /etc/rc.d/rc.local

# set NTP sed -i '/server 0.centos.pool.ntp.org iburst/c server 202.170.119.19' /etc/ntp.conf
sed -i '/server 1.centos.pool.ntp.org iburst/c server 202.170.119.9' /etc/ntp.conf
sed -i '/server 2.centos.pool.ntp.org iburst/c server 103.246.188.99' /etc/ntp.conf
sed -i '/server 3.centos.pool.ntp.org iburst/c #' /etc/ntp.conf
systemctl enable ntpd
systemctl restart ntpd

# set NTP sed -i '/server 0.centos.pool.ntp.org iburst/c server 202.170.119.19' /etc/chronyd.conf
sed -i '/server 1.centos.pool.ntp.org iburst/c server 202.170.119.9' /etc/chronyd.conf
sed -i '/server 2.centos.pool.ntp.org iburst/c server 103.246.188.99' /etc/chronyd.conf
sed -i '/server 3.centos.pool.ntp.org iburst/c #' /etc/chronyd.conf
systemctl enable chronyd
systemctl restart chronyd
# sshd config sed -i '/Defaults requiretty/c #Defaults requiretty' /etc/sudoers sed -i '/#UseDNS yes/c UseDNS no' /etc/ssh/sshd_config systemctl restart sshd # set SELINUX=permissive setenforce 0 sed -i '/SELINUX=enforcing/c SELINUX=disabled' /etc/sysconfig/selinux sed -i '/SELINUX=enforcing/c SELINUX=disabled' /etc/selinux/config echo "export EDITOR=\"vim\"" >> .bashrc echo "alias vi='vim'" >> .bashrc sed -i '/alias rm/d' /root/.bashrc sed -i '/alias cp/d' /root/.bashrc sed -i '/alias mv/d' /root/.bashrc # Update to Lastest version yum -y update ## Set snmpd SNMPNAME=ProenCloud echo "com2sec mynetwork 0.0.0.0/0 $SNMPNAME" > /etc/snmp/snmpd.conf echo "group MyROGroup any mynetwork" >> /etc/snmp/snmpd.conf echo "view all included .1 80" >> /etc/snmp/snmpd.conf echo "access MyROGroup \"\" any noauth 0 all none none" >> /etc/snmp/snmpd.conf echo "syslocation Thailand" >> /etc/snmp/snmpd.conf echo "syscontact IT <[email protected]>" >> /etc/snmp/snmpd.conf echo "" >> /etc/snmp/snmpd.conf systemctl enable snmpd systemctl start snmpd # Set Hostname HOSTNAMETODO="HOSTNAME" hostnamectl set-hostname $HOSTNAMETODO --static # Restart to Lastest reboot # Remove unuse kernel yum -y remove kernel # Set up Firewall
# Looping through the content of a file in Bash

while
read p; do echo "$p" done <peptides.txt