天天看點

Linux基礎操作優化

yum更新 

#yum  grouplist     #yum  groupinstall " "

#yum  upgrade    # yum  update

yum -y update更新所有包,改變軟體設定和系統設定,系統版本核心都更新

yum -y upgrade更新所有包,不改變軟體設定和系統設定,系統版本更新,核心不改變

# yum install tree telnet   dos2unix  sysstat  lrzsz -y

# sed -i  s#SELINUX=enforcing#SELINUX=disabled#g  /etc/selinux/config

# getenforce                    

# runlevel     # vi /etc/inittab   #init   

#setup   #ntsysv

#LANG=EN

# chkconfig --list  |grep "3:on"

關閉所有服務#for   hequan  in  `chkconfig --list  |grep "3:on" | awk '{print $1}'`;do  chkconfig  $hequan    off;done

crond  network  rsyslog   sshd   4個開機服務  

# for   hequan  in  sshd crond network  rsyslog;do  chkconfig  $hequan    on;done

# for   hequan   in  `chkconfig --list | grep "3:on"  | awk '{print  $1}' | grep -vE  "crond|network|sshd|rsyslog" `; do chkconfig $hequan off; done

# vi /etc/ssh/sshd_config

# cat /etc/sysconfig/i18n

LANG="zh_CN.UTF-8"                    # echo 'LANG="zh_CN.UTF-8"'  > /etc/sysconfig/i18n

# /usr/sbin/ntpdate   time.nist.gov    時間更新

# echo '*/5  * * * * /usr/sbin/ntpdate  time.nist.gov > /dev/null   2>&1'  >>/var/spool/cron/root

# crontab -l

# ulimit -n

# echo ‘'*      -   nofile  65535 ' >> /etc/security/limits.conf

# vi /etc/sysctl.conf  優化核心

# cat /etc/issue   開機登陸界面

# chattr +i /etc/passwd

# lsattr /etc/passwd

# vi /etc/motd

登陸顯示

本文轉自 295631788 51CTO部落格,原文連結:http://blog.51cto.com/hequan/1757932,如需轉載請自行聯系原作者

繼續閱讀