CentOS作業系統版本資訊查看和隱藏
工作中需要查看一下作業系統版本,或者是源碼編譯安裝時,到網上下載對應的源碼包,需要提前擷取作業系統版本資訊。然而,作業系統資訊能簡單使用命令擷取,顯然是不安全的,這樣給我們的系統帶來很大的隱患。這就需要我們對作業系統資訊進行一定的偽裝,來迷惑想要攻擊我們系統的人。這樣會使我們的系統更加安全。
查看作業系統版本資訊的命令很多,下面列出一些常用的查看方式:
1.uname -a
[root@localhost~]#uname-aLinuxlocalhost.localdomain2.6.32-642.el6.x86_64#1SMPTueMay1017:27:01UTC2016x86_64x86_64x86_64GNU/Linux[root@localhost~]#
2.cat /etc/issue
[root@localhost~]#cat/etc/issueCentOSrelease6.8(Final)Kernel\ronan\mMageEducationLearningServiceshttp://www.magedu.com[root@localhost~]#
3.lsb_release -a如命令不能使用,需要安裝redhat-lsb--->yum install -y redhat-lsb.x86_64
[root@localhost~]#lsb_release-aLSBVersion::base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarchDistributorID:CentOSDescription:CentOSrelease6.8(Final)Release:6.8Codename:Final[root@localhost~]#
4.cat /etc/redhat-release
[root@localhost~]#cat/etc/redhat-releaseCentOSrelease6.8(Final)[root@localhost~]#
以上是幾種查看作業系統資訊的方式,有些顯示資訊詳細,有些僅僅簡略顯示作業系統資訊,工作中根據需要使用不同的命令。
在使用上述命令查看作業系統資訊的過程,實際上都是在讀取/etc/issue和/etc/redhat-release中的資訊。所以我們只要對這兩個檔案中的作業系統相關的資訊進行修改,就能達到我們的目的。