Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Jul 11 '13 at 20:48

This question came from our site for professional and enthusiast programmers.

1  
Most systems these days have lsb_release. –  vanza Jul 11 '13 at 20:22
    
Did you want the kernel version, or the distro name? You already get the kernel version with uname -a (see harald's answer). –  ajp15243 Jul 11 '13 at 20:25
    
I want the distro name. –  Saul Lugo Jul 11 '13 at 20:28
1  
Related Super User question, since this question was migrated from Stack Overflow. –  ajp15243 Jul 11 '13 at 20:56
1  
Did you try the social approach? Simply ask the server owner/admin. –  AnonymousLurker Jul 12 '13 at 4:21
show 1 more comment

6 Answers 6

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

lsb_release -a
share|improve this answer
    
No luck, I don't have the command lsb_release in my system. –  Saul Lugo Jul 11 '13 at 20:25
add comment

Try this...

$ cat /etc/*-release
share|improve this answer
    
There is not release* file into the /etc directory. –  Saul Lugo Jul 11 '13 at 20:24
    
@SaulLugo It's *-release, not release*. For instance, I'm running Arch Linux, so I have arch-release, lsb-release, and os-release in /etc/. –  ajp15243 Jul 11 '13 at 20:27
    
[/etc]# ls *-release /bin/ls: cannot access *-release: No such file or directory –  Saul Lugo Jul 11 '13 at 20:42
    
Saul, have you tried cat /etc/issue as I indicated in my comment on your question? The linked Stack Overflow question indicated that command may work out on older distros. –  ajp15243 Jul 11 '13 at 21:07
add comment

"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
share|improve this answer
add comment

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

share|improve this answer
    
Oh, you've have a login on the box, nm –  dougEfresh Jul 11 '13 at 20:22
    
... and that would just yield Linux 3 anyways, and not a specific distribution –  phihag Jul 11 '13 at 23:16
add comment

If its debian check

cat /etc/debian_version

or more genrally

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

should match most distros

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.