Linux系統(tǒng)調(diào)優(yōu)
1、SELinux
修改selinux配置文件,
#vi /etc/selinux/config
...
SELINUX=disabled
...
必須重啟后生效,但可使用setenforce臨時(shí)生效來關(guān)閉
#setenforce 0
2、lnittab
配置文件在/etc/inittab,centos7后使用syetemctl來設(shè)置
... multi-user.target: analogous to runlevel 3 graphical.target: analogous to runlevel 5 ...
multi-user.target相當(dāng)于之前的更改運(yùn)行級(jí)別為3,意思就是命令行。
graphical.target相當(dāng)于之前的更改運(yùn)行級(jí)別為5,意思就是圖形界面。
查看當(dāng)前的開機(jī)默認(rèn)運(yùn)行方式:#systemctl get-default 設(shè)置開機(jī)啟動(dòng)命令行:#systemctl set-default multi-user.target 設(shè)置開機(jī)啟動(dòng)圖形界面:#systemctl set-default graphical.target
3、關(guān)閉防火墻
centos6
關(guān)閉防火墻:#service iptables stop
永久關(guān)閉:#chkconfig iptables off
centos7
關(guān)閉防火墻:#systemctl stop firewall
永久關(guān)閉:#systemctl disabled firewall
4、設(shè)置字符集
centos6
#vi /etc/sysconfig/i18n LANG="zh_CN.UTF-8"
centos7
#vi /etc/locale.conf LANG="zh_CN.UTF-8"
5、設(shè)置命令行歷史記錄
#export TMOUT=600 //超時(shí)時(shí)間 #export HISTSIZE=5 //命令行的記錄數(shù)量 #export HISTFILESIZE=5 //歷史記錄文件的數(shù)量 若永久生效需需要在配置文件中添加立即生效 #source /etc/profile
6、清除登錄時(shí)的版本信息
> /etc/issue
> /etc/issue.net

浙公網(wǎng)安備 33010602011771號(hào)