且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Linux基础操作优化

更新时间:2022-09-14 10:04:22

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

Linux基础操作优化

# 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

Linux基础操作优化

# vi /etc/motd

登陆显示










本文转自 295631788 51CTO博客,原文链接:http://blog.51cto.com/hequan/1757932,如需转载请自行联系原作者