System initialization script after Linux is launched

Source: Internet
Author: User

System initialization script after Linux is launched

#!/bin/bash# Program:# system_init_shellcat << EOF +--------------------------------------------------------------+ |        === Welcome to RedHat 6.x System init ===      | +--------------------------------------------------------------+EOF#update 163 yum#cd /etc/yum.repos.d#mv CentOS-Base.repo  CentOS-Base.repo.bak#wget http://mirrors.163.com/.help/CentOS-Base-163.repo#mv CentOS-Base-163.repo  CentOS-Base.repo#yum clean metadata#yum makecache#add epel#rpm -Uvh http://download.Fedora.RedHat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm#rpm  –import  /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6#add rpmforge#rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm#rpm –import  /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag#update system packyum -y install gcc gcc-c++ make autoconf libtool-ltdl-devel gd-devel freetype-devel libxml2-devel libjpeg-devel libpng-devel openssl-devel curl-devel bison patch unzip libmcrypt-devel libmhash-devel ncurses-devel sudo bzip2 mlocate flex lrzsz sysstat lsof setuptool  system-config-network-tui system-config-firewall-tui ntp libaio-devel wget ntp#set ntpecho "2 5 * * * /usr/sbin/ntpdate 10.10.2.165;/sbin/clock -w >/dev/null 2>&1" >> /var/spool/cron/root/usr/sbin/ntpdate 10.10.2.165;/sbin/clock -w >/dev/null 2>&1service crond restart#set ulimit#echo "ulimit -SHn 65536" >> /etc/rc.localcat >> /etc/security/limits.conf << EOF *           soft   nofile       65536 *           hard   nofile       65536 *           soft   nproc        65536 *           hard   nproc        65536EOF#set max user processessed -i 's/1024/102400/' /etc/security/limits.d/90-nproc.conf# turnoff the control-alt-deletesed -i 's#exec /sbin/shutdown -r now#\#exec /sbin/shutdown -r now#' /etc/init/control-alt-delete.conf#close useless servicechkconfig --level 2345 iptables off/etc/init.d/xinetd startchkconfig xinetd onchkconfig rsync onlsof -i:873echo "service is init is ok.............."#set sshsed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_configsed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_configservice sshd restart#set hosts.allowcat >> /etc/security/limits.conf << EOFsshd:10.10.1.60sshd:10.10.1.61sshd:10.10.2.101sshd:10.10.2.100EOF#disable ipv6echo "alias net-pf-10 off" >> /etc/modprobe.confecho "alias ipv6 off" >> /etc/modprobe.conf/sbin/chkconfig ip6tables offecho "ipv6 is disabled!"#vim settingsed -i "8 s/^/alias vi='vim'/" /root/.bashrcecho 'syntax on' > /root/.vimrccat << EOF +--------------------------------------------------------------+ |                    ===System init over===       | +--------------------------------------------------------------+EOFecho "###############################################################"

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.