自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

精益求精的CentOS操作系統(tǒng)安全設(shè)置

系統(tǒng) Linux
現(xiàn)在的CentOS操作系統(tǒng)存在著很多的安全威脅,我們可以從一些電腦的設(shè)置上來保護(hù)電腦的安全。或者更新CentOS操作系統(tǒng)。

這次我們講的還是安全問題,在CentOS操作系統(tǒng)中,可以通過有效的安全設(shè)置來避免很多的問題。下面這些設(shè)置可以很好的保護(hù)你的電腦不在受到打擾。

因?yàn)閞oot用戶對(duì)CentOS操作系統(tǒng)具有全權(quán)的操作權(quán)限,為了避免一些失誤的操作,建議在一般情況下,以一般用戶登錄CentOS操作系統(tǒng),必要的時(shí)候需要root操作權(quán)限時(shí),再通過“su -”命令來登錄為root用戶進(jìn)行操作。

在一般情況下,一般用戶通過執(zhí)行“su -”命令、輸入正確的root密碼,可以登錄為root用戶來對(duì)CentOS操作系統(tǒng)進(jìn)行管理員級(jí)別的配置。但是,為了更進(jìn)一步加強(qiáng)CentOS操作系統(tǒng)的安全性,有必要建立一個(gè)管理員的組,只允許這個(gè)組的用戶來執(zhí)行“su -”命令登錄為root用戶,而讓其他組的用戶即使執(zhí)行“su -”、輸入了正確的root密碼,也無法登錄為root用戶。在UNIX下,這個(gè)組的名稱通常為“wheel”。

首先我們創(chuàng)建兩個(gè)普通的用戶tom john
[root@www ~]# useradd tom
[root@www ~]# passwd tom
輸入你的密碼
[root@www ~]# useradd john
[root@www ~]# passwd john
輸入你的密碼
[root@www ~]# usermod -g wheel tom 將tom用戶加入到wheel組中
[root@www ~]# vi /etc/pam.d/su  ← 打開這個(gè)配置文件找到這句話在第六行將其前面的#注釋掉
# auth            required        pam_wheel.so use_uid
[root@www ~]# echo "SU_WHEEL_ONLY yes" >> /etc/login.defs

然后你可以分別用tom和john登陸,沒有加入到wheel組的用戶,執(zhí)行“su -”命令,即使輸入了正確的root密碼,也無法登錄為root用戶
在CentOS操作系統(tǒng)出現(xiàn)錯(cuò)誤或有重要通知發(fā)送郵件給root的時(shí)候,讓系統(tǒng)自動(dòng)轉(zhuǎn)送到我們通常使用的郵箱中,這樣方便查閱相關(guān)報(bào)告和日志。
[root@www ~]# vi /etc/aliases
在這兩句下面mailer-daemon:  postmaster
postmaster:root
加入這句話root:zy66289214@126.com 這里寫自己郵箱
[root@www ~]# newaliases   重建aliasesdb
[root@www ~]# echo test | mail root 發(fā)送測試軟件給root
[8] 定義yum的非官方庫
在服務(wù)器構(gòu)建的過程中,我們將要用到的一些工具不存在于CentOS操作系統(tǒng)中yum的官方庫中,所以需要定義yum的非官方庫文件,讓一些必需的工具通過yum也能夠安裝。

[root@sample ~]# vi /etc/yum.repos.d/dag.repo  ← 建立dag.repo,定義非官方庫
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
[root@sample ~]# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt  ← 導(dǎo)入非官方庫的GPG

[9] CentOS操作系統(tǒng)停止打印服務(wù)

如果不準(zhǔn)備提供打印服務(wù),停止默認(rèn)被設(shè)置為自動(dòng)啟動(dòng)的打印服務(wù)。
[root@sample ~]# /etc/rc.d/init.d/cups stop  ← 停止打印服務(wù)
Stopping cups:            [ OK ]    ← 停止服務(wù)成功,出現(xiàn)“OK”
[root@sample ~]# chkconfig cups off  ← 禁止打印服務(wù)自動(dòng)啟動(dòng)
[root@sample ~]# chkconfig --list cups  ← 確認(rèn)打印服務(wù)自啟動(dòng)設(shè)置狀態(tài)
cups 0:off 1:off 2:off 3:off 4:off 5:off 6:off  ← 0-6都為off的狀態(tài)就OK(當(dāng)前打印服務(wù)自啟動(dòng)被禁止中)
[10] 停止ipv6

在CentOS操作系統(tǒng)默認(rèn)的狀態(tài)下,ipv6是被啟用的狀態(tài)。因?yàn)槲覀儾皇褂胕pv6,所以,停止ipv6,以***限度保證安全和快速。

首先再次確認(rèn)一下ipv6功能是不是被啟動(dòng)的狀態(tài)。

[root@www ~]# ifconfig -a ← 列出全部網(wǎng)絡(luò)接口信息
sit0 Link encap:IPv6-in-IPv4 ← 確認(rèn)ipv6是被啟動(dòng)的狀態(tài)
[root@www ~]# vi /etc/modprobe.conf← 修改相應(yīng)配置文件,添加如下行到文尾:
alias net-pf-10 off
alias ipv6 off
[root@www ~]# shutdown -r now  ← 重新啟動(dòng)系統(tǒng),使設(shè)置生效
修改/etc/yum.repos.d/CentOS-Base.repo,將鏡象站點(diǎn)地址改為在中國的鏡象站點(diǎn)地址。不然我們通過yum安裝軟件速度會(huì)極慢。修改如下
 

  1. # CentOS-Base.repo  
  2. #  
  3. # This file uses a new mirrorlist system developed by Lance Davis for CentOS.  
  4. # The mirror system uses the connecting IP address of the client and the  
  5. # update status of each mirror to pick mirrors that are updated to and  
  6. # geographically close to the client. You should use this for CentOS updates  
  7. # unless you are manually picking other mirrors.  
  8. #  
  9. # If the mirrorlistdoes not work for you, as a fall back you can try the  
  10. # remarked out baseurlline instead.  
  11.  
  12. [base]  
  13. name=CentOS-$releasever - Base  
  14. baseurl=http://mirrors.shlug.org/centos/$releasever/os/$basearch/  
  15. gpgcheck=1 
  16. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  
  17. protect=1 
  18. #released updates  
  19. [updates]  
  20. name=CentOS-$releasever - Updates  
  21. baseurl=http://mirrors.shlug.org/centos/$releasever/updates/$basearch/  
  22. gpgcheck=1 
  23. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  
  24. protect=1 
  25. #packages used/produced in the build but not released  
  26. [addons]  
  27. name=CentOS-$releasever - Addons  
  28. baseurl=http://mirrors.shlug.org/centos/$releasever/addons/$basearch/  
  29. gpgcheck=1 
  30. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  
  31. protect=0 
  32. #additional packages that may be useful  
  33. [extras]  
  34. name=CentOS-$releasever - Extras  
  35. baseurl=http://mirrors.shlug.org/centos/$releasever/extras/$basearch/  
  36. gpgcheck=1 
  37. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  
  38. protect=0 
  39. #additional packages that extend functionality of existing packages  
  40. [centosplus]  
  41. name=CentOS-$releasever - Plus  
  42. baseurl=http://mirrors.shlug.org/centos/$releasever/centosplus/$basearch/  
  43. gpgcheck=1 
  44. enabled=0 
  45. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  
  46. protect=1 
  47. #contrib - packages by Centos Users  
  48. [contrib]  
  49. name=CentOS-$releasever - Contrib  
  50. baseurl=http://mirrors.shlug.org/centos/$releasever/contrib/$basearch/  
  51. gpgcheck=1 
  52. enabled=0 
  53. protect=0 
  54. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  


更新CentOS操作系統(tǒng)[root@www ~]#yum -y upgrade

【編輯推薦】

  1. CentOS操作系統(tǒng)安裝教程
  2. 在CentOS安裝pptpd以及部署
  3. 初學(xué)者如何對(duì)linux CentOS安裝
  4. CentOS安裝的瑣碎問題集
  5. 快速解決CentOS安裝后的初始化問題
責(zé)任編輯:小霞
相關(guān)推薦

2017-07-06 15:50:08

2024-11-15 12:24:53

2010-04-07 10:15:04

Unix操作系統(tǒng)

2024-10-31 12:15:04

2010-04-07 18:51:26

2010-04-14 17:54:06

2010-04-07 10:29:01

Unix操作系統(tǒng)

2010-04-15 17:44:59

2009-07-19 15:02:56

2009-11-30 10:50:24

Suse Linux

2009-06-25 08:54:27

Linux操作系統(tǒng)

2010-04-20 23:05:04

2010-04-19 09:12:25

2010-04-20 10:21:56

2021-10-12 21:37:51

Windows 10Windows微軟

2010-03-30 14:07:26

CentOS系統(tǒng)

2010-04-14 12:46:31

2012-08-29 13:39:29

2016-06-14 09:17:01

2013-03-08 09:46:34

Linux操作系統(tǒng)安全性
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)