6. Prendre connaissance de la version de la distribution

1. Dans toutes les distributions

Communément le fichier /etc/os-release donnera cette information concernant la version de la distribution.

root@debian8:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

2. En RHEL7/Centos7

En RHEL7/Centos7, on trouve d'autres fichiers.

[root@centos7 ~]# ls /etc/*-rel*
/etc/centos-release       /etc/os-release      /etc/system-release
/etc/centos-release-upstream  /etc/redhat-release  /etc/system-release-cpe
[root@rhel7 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)

3. En Debian / Ubuntu

En Debian / Ubuntu, on trouve le fichier /etc/debian_version

root@debian8:~# cat /etc/debian_version
8.7

La commande lsb_release -a permet d'obtenir cette information .

root@debian7:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.11 (wheezy)
Release:    7.11
Codename:   wheezy
root@debian8:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.7 (jessie)
Release:    8.7
Codename:   jessie
root@kali:~# lsb_release -a
No LSB modules are available.
Distributor ID: Kali
Description:    Kali GNU/Linux 1.1.0
Release:    1.1.0
Codename:   moto
user@ubuntu1604:~$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:    16.04
Codename:   xenial
msfadmin@metasploitable:~$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 8.04
Release:    8.04
Codename:   hardy

Commentaires