新聞中心
在Linux中對系統(tǒng)進(jìn)行調(diào)優(yōu)可以大幅度的提高系統(tǒng)的工作效率,本篇文章為大家講解一下Linux中常用的調(diào)優(yōu)方法,有需要的小伙伴可以參考一下。

茄子河ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書合作)期待與您的合作!
關(guān)閉selinux功能
selinux是美國國家安全局對于強(qiáng)制訪問控制的實(shí)現(xiàn),這個功能很強(qiáng)大,同時又很麻煩,大多是運(yùn)維人員都選擇將其關(guān)閉,利用其它途徑增加安全性。
此命令是永久關(guān)閉selinux,執(zhí)行后重啟系統(tǒng)生效。
[root@chao selinux]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
開機(jī)自啟服務(wù)
linux系統(tǒng)和windows系統(tǒng)類似,開機(jī)也會自啟一些服務(wù),沒用的服務(wù)即會占用資源又有安全隱患,需要把必須運(yùn)行的服務(wù)開機(jī)自啟,其他的關(guān)閉。
需要開機(jī)自啟的服務(wù):
-
sshd,遠(yuǎn)程連接需要使用此服務(wù)
-
rsyslog,日志有關(guān)的軟件
-
networ,網(wǎng)絡(luò)相關(guān)的軟件
-
crond,定時任務(wù)相關(guān)軟件
-
sysstat數(shù)據(jù)分析的軟件
查看目前開機(jī)自啟的服務(wù)
[root@chao selinux]# systemctl list-unit-files|grep enabled
abrt-ccpp.service enabled
abrt-oops.service enabled
abrt-vmcore.service enabled
abrt-xorg.service enabled
abrtd.service enabled
atd.service enabled
auditd.service enabled
[email protected] enabled
chronyd.service enabled
crond.service enabled
dbus-org.fedoraproject.FirewallD1.service enabled
dbus-org.freedesktop.ModemManager1.service enabled
dbus-org.freedesktop.NetworkManager.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
dmraid-activation.service enabled
firewalld.service enabled
[email protected] enabled
irqbalance.service enabled
iscsi.service enabled
kdump.service enabled
ksm.service enabled
ksmtuned.service enabled
libstoragemgmt.service enabled
libvirtd.service enabled
例如想關(guān)閉一個
[root@chao selinux]# systemctl disable postfix.service
Removed symlink /etc/systemd/system/multi-user.target.wants/postfix.service.
設(shè)置ssh服務(wù)
編輯/etc/ssh/sshd_config文件 更改默認(rèn)端口為Port 22222 保存退出,重啟服務(wù)!
linux中文設(shè)置
查看系統(tǒng)是否是 zh_CN.UTF-8 如果不是手動添加一行到此文件。
[root@chao etc]# cat locale.conf
LANG="zh_CN.UTF-8"
設(shè)置賬戶超時時間
[root@chao ~]# echo 'export TMOUT=300' >>/etc/profile
[root@chao ~]# source /etc/profile
[root@chao ~]# env |grep -i tmout
[root@chao ~]# vim /etc/profile
[root@chao ~]# source /etc/profile
[root@chao ~]# 等待輸入超時:自動登出
Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(172.16.1.16) at 11:01:36.
Type `help' to learn how to use Xshell prompt.
設(shè)置命令行歷史記錄數(shù)
將原來的5條改成10條
[root@chao ~]# sed -i 's/^HISTSIZE=5/HISTSIZE=10/' /etc/profile
[root@chao ~]# source /etc/profile
隱藏系統(tǒng)版本
[root@chao ~]# echo redflag 5.9 >/etc/issue
[root@chao ~]# cat /etc/issue
redflag 5.9
鎖定重要文件
[root@chao ~]# chattr -i /etc/passwd /etc/shoadow /etc/group /etc/gshadow /etc/inittab
以上就是常用的優(yōu)化步驟!
當(dāng)前標(biāo)題:Linux中常用的調(diào)優(yōu)方法
分享地址:http://m.fisionsoft.com.cn/article/coegohd.html


咨詢
建站咨詢
