| 工作中需要查看一下操作系统版本,或者是源码编译安装时,到网上下载对应的源码包,需要提前获取操作系统版本信息。然而,操作系统信息能简单使用命令获取,显然是不安全的,这样给我们的系统带来很大的隐患。这就需要我们对操作系统信息进行一定的伪装,来迷惑想要攻击我们系统的人。这样会使我们的系统更加安全。 查看操作系统版本信息的命令很多,下面列出一些常用的查看方式: 1.uname -a | 1 2
 3
 
 | [iyunv@localhost ~]# uname -a Linux localhost.localdomain 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
 [iyunv@localhost ~]#
 
 
 | 
 
 
 2.cat /etc/issue | 1 2
 3
 4
 5
 6
 7
 8
 
 | [iyunv@localhost ~]# cat /etc/issue CentOS release 6.8 (Final)
 Kernel \r on an \m
 
 Mage Education Learning Services
 http://www.magedu.com
 
 [iyunv@localhost ~]#
 
 
 | 
 
 
 3.lsb_release -a 如命令不能使用,需要安装redhat-lsb--->yum install -y redhat-lsb.x86_64 | 1 2
 3
 4
 5
 6
 7
 
 | [iyunv@localhost ~]# lsb_release -a LSB Version:    :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-noarch
 Distributor ID: CentOS
 Description:    CentOS release 6.8 (Final)
 Release:        6.8
 Codename:       Final
 [iyunv@localhost ~]#
 
 
 | 
 
 
 4.cat /etc/redhat-release | 1 2
 3
 
 | [iyunv@localhost ~]# cat /etc/redhat-release CentOS release 6.8 (Final)
 [iyunv@localhost ~]#
 
 
 | 
 
 
 以上是几种查看操作系统信息的方式,有些显示信息详细,有些仅仅简略显示操作系统信息,工作中根据需要使用不同的命令。 在使用上述命令查看操作系统信息的过程,实际上都是在读取/etc/issue和/etc/redhat-release中的信息。所以我们只要对这两个文件中的操作系统相关的信息进行修改,就能达到我们的目的。 
 |