How can I determine the distro of Linux that is running on a remote server?

Solution 1:

Try this...

$ cat /etc/*-release

Solution 2:

If you are lucky, some information can be obtained by running

lsb_release -a

Solution 3:

"2.6.32-20130307.60.9.bh6.x86_64" suggests CentOS or RedHat Linux. To find out what version of CentOS it is (if it is CentOS), use:

cat /etc/redhat-release

or more generally:

cat /etc/*release

Another way to go about it is to look in /etc for configuration files, like update servers and repositories, which are distro-specific.

This:

cat /etc/issue*

might also provide some clues.

Yet another way to go about it is to look for which package manager is installed. Try these:

apt-get -v
yum --version
pacman --version
emerge --version
pkgtool

If you find one them, use them to search for a "lsb-release" or similarly named package, and if found, install it and try:

lsb_release -a

Solution 4:

Try using nmap's OS detection: http://nmap.org/book/man.html