使用しているOSを調べるコマンド(nmap、uname)

unameで調べる

OSのカーネルは、unameに-aオプションを付けて調べることができます。

[user@myserver ~]$ uname -a
Linux myserver 2.6.18-274.7.1.el5xen #1 SMP Thu Oct 20 17:06:34 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

nmapで調べる

もう一つ、nmapを使う方法もあります。
nmapはポートスキャン用のコマンドですが、これでマシンのOSを調べることができます。
OS調査オプションの-Oを付けることによって、OSを調査します。

ただし、これはあくまで「調査」して推測するコマンドなので、100%正しいバージョンが分かるわけではありません。
そのかわり、外部サーバーに対して実行することもできます。

[root@myserver ~]# nmap -O myserver
Starting Nmap 6.01 ( http://nmap.org ) at 2013-01-09 01:48 JST
Nmap scan report for myserver (210.000.000.000)
Host is up (0.000025s latency).
Not shown: 997 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
10000/tcp open snet-sensor-mgmt
Device type: general purpose
Running: Linux 2.6.X
OS CPE: cpe:/o:linux:kernel:2.6
OS details: Linux 2.6.26
Network Distance: 0 hops

OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 2.15 seconds

「Running: Linux 2.6.X」
「OS details: Linux 2.6.26」
と出ました。
nmapコマンドは、/usr/share/nmap/nmap-os-db の中からTCP/IP fingerprintをもとに推測を行ないます。

command not found の場合は yum install nmp で事前にnmpをインストールします。

1 thought on “使用しているOSを調べるコマンド(nmap、uname)

  1. AlexisBrums

    Examples of Aphorism in Literature
    This quote originated from Thomas Howell in New Sonnets and Pretty Pamphlets.
    If you can do something, then you need to do it for the good of others.
    Like George Washington, Sandys believed that telling the truth is always the way to go.
    People often use this quote when discussing health, but Franklin was talking about fire safety.
    Now you might be asking.
    Ready to Use These Aphorism Examples In Your Writing.
    Aphorisms are so common that we hardly think twice about them.
    Proverbs, on the other hand, can be much longer than aphorisms and adages.
    Here’s a classic Japanese saying for you.
    He knows that Luke should either decide that he can do it or decide to quit.
    Picture of Benjamin Franklin and a caption that says “Aphorist Extraordinaire”
    Want a few more.
    Not so much.
    So my advice.
    An aphorism is a literary device that uses a short, clever saying to express a general truth.

    返信

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です