11
5
I am trying to determine what flavor of linux server is running. I am not trying to determine the kernel version - but rater the distributor.
gcc is installed, and in the version output, it says RedHat
# gcc --version
gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-11)
Does this mean I can safely assume my server is a RedHat server. Is there a better - 100% bulletproof method to find this out? Also for other linux flavors - not just this server?
Edit: contents of /etc/
in case it helps - but I would like a solution that works for other versions of linux too.
# ls /etc/
./ backupmxhosts domainusers host.conf localdomains mailips pam.d/ relayhosts shadow trustedmailhosts
../ bashrc* exim.conf inputrc localtime man.config passwd resolv.conf skipsmtpcheckhosts userdomains
DIR_COLORS cron.deny exim.pl ld.so.cache lynx.cfg mtab profile secondarymx spammeripblocks vimrc
aliases demodomains exim.pl.local* ld.so.conf mail/ my.cnf profile.d/ senderverifybypasshosts sudoers
antivirus.exim demouids group localaliases mailhelo nsswitch.conf protocols services termcap
I have no *release
or *version
files in /etc/
# ls /etc*release; ls /etc/*version
/bin/ls: /etc/*release: No such file or directory
/bin/ls: /etc/*version: No such file or directory
I tried LSB
# lsb_release -a
LSB Version:
Distributor ID: n/a
Description: (none)
Release: n/a
Codename: n/a
Also - I guess I am inside a chroot jail
(not really sure what that is) which could likely be the cause for this issue.
Updated:
I think this does it for me. I think I can safely assume I am using cent-os.
# cat /proc/version
Linux version 2.6.9-103.plus.c4smp (mockbuild@builder10.centos.org) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-11)) #1 SMP Wed Dec 21 16:17:23 EST 2011
Why do you need to know? Perhaps instead testing for common distribution-specific tools (package managers, for instance) will do what you want? – Daniel Pryden – 2011-10-07T21:21:56.697
1Well, what I really want to know is if I can replicate the server as a virtual machine locally, and then install stuff on local virtual machine, then copy the binaries over to the remote machine. I thought finding out the correct platform would be a good starting point. – Billy Moon – 2011-10-07T21:29:12.883
2The above directory listing is incomplete (e.g. hosts is missing, init.d, rc*). Is this a test? – None – 2011-10-07T21:38:16.910
How are you accessing this server? Is it possible that you don't have access to the server's filesystem directly, but are instead inside a chroot jail? – Daniel Pryden – 2011-10-07T21:52:48.657
I guess I could be inside a chroot jail - does this mean I can not find out what the underlying system is? – Billy Moon – 2011-10-07T22:03:03.580
Binary copy instead of using package-manager considered as very bad style! Root of this host will kill you – Lazy Badger – 2011-10-09T00:45:12.223
That is a crazy-old version of
gcc
. Just where did you find this server? Makes me wonder just how many known security vulnerabilities are on a machine this ancient... – sarnold – 2011-10-09T01:12:48.480hm. speaking of package manager.. what is the package manager in place? you might be able to guess from what repos are there. – Journeyman Geek – 2011-10-10T05:13:37.093