12

I am trying to know which version of Linux a remote server is running. I connected to my account there with SSH and used the following command: uname -a

And I got: Linux just103.justhost.com 2.6.32-20130307.60.9.bh6.x86_64 #1 SMP Thu Mar 7 15:58:33 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

But that doesn't tell me which version of Linux it is.

Any advice? Thanks,

Saul

There is a file lynx.cfg, so I did head lynx.cfg and it has:

The default placement for this file is /etc/lynx.cfg (Red Hat Linux, Fedora)

So, does it meas that the system is Red Hat linux or Fedora?

Saul Lugo
  • 131

7 Answers7

9

Try this...

$ cat /etc/*-release
austin
  • 968
  • 1
  • 6
  • 9
9

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

lsb_release -a
choroba
  • 20,299
4

"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
Nikos C.
  • 339
  • 1
  • 8
1

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

0

Check all /etc/* in this function:

https://github.com/saltstack/salt/blob/059f44a4d42ccfa5006b02fc4b01784ac5440eab/salt/grains/core.py#L671

HVNSweeting
  • 908
  • 1
  • 9
  • 17
0

If its debian check

cat /etc/debian_version

or more genrally

cat /etc/*-release
cat /etc/*version

should match most distros

exussum
  • 511
0

If you have yum command available then it is a RedHat/CentOS/Oracle then check your yum repository settings.

If you have apt-get then it is Debian related and again check your software repositories to find out exactly what distribution it is.

If you don't have any of them, then ask the person who created your user account ;)