=======================System Optimization ======================Check Hardware: Dmidecode | Grep"Product Name"Check Cpu:grep name/proc/cpuinfoTurn off firewall: Chkconfig iptables off/etc/init.d/iptables STOPVI/etc/selinux/config# selinux=enforcingselinux=disabledsed-i ' s#SELINUX =disabled#selinux=enforcing#g '/etc/selinux/configTemporary entry into force: Setenforce 0Add User: Useradd lsq2016Echo"123456" | passwd--stdin lsq2016 &&History-c#Add a user password and clear the historyAdd YumSource: http:mirrors.cnlinux.net/centos/6.2/os/x86_64/packages/#rpmDownload http:mirrors.sohu.com/Tested under: Yum install Lrzsz-y#szUpload and Download toolUpgrade the system to the latest:。。。Optimized boot-up: For ABC in ' Chkconfig--list | grep 3: On | awk ' {print '} ';d o chkconfig--level 3 $abc off;donefor ABC in Crond network Rsyslog sshd;do chkconfig--level 3 $abc On;doneChange SSHConfiguration: CP/etc/ssh/ssh_config/ETC/SSH/SSH_CONFIG.BAKVI CP/etc/ssh/ssh_config\cp/etc/ssh/ssh_config/etc/ssh/ssh_config.baksed-i ' S%port 22%port 51234%g '/etc/ssh/ssh_configsed-i ' S%permitrootlogin yes%permitrootlogin no%g '/etc/ssh/ssh_configsed-i ' s%permitemptypasswords no%permitemptypasswords yes%g '/etc/ssh/ssh_configsed-i ' S%usedns yes%usedns no%g '/etc/ssh/ssh_config/etc/init.d/sshdReload && Action/bin/truelsq2016User added to SudoInEcho"Lsq2016 all= (All) all" >>/etc/sudoers#Note Back up firstTo change the Chinese display:Echo ' lang="ZH_CN. UTF-8 "' >>/etc/sysconfig/i18nsource/etc/sysconfig/i18nServer time synchronization:Echo ' */5 * * * * * /usr/sbin/ntpdate time.windowns.com >/dev/null 2>&1 ' >>
/var/spool/cron/rootcrondtab-l
# Check enlarged file descriptor:Echo ' *-nofile 65535 ' >> /etc/security/ Limits.conf or Ulimit-shn 65535 add to /etc/rc.local tuning kernel tuning:/etc/sysctl.conf has only encountered time_ at present WAIT too much and the TCP window size tuning sysctl-p # takes effect
Linux system optimization