Posted by HostSentry, 11-15-2007, 12:28 AM | Without having all of the operating systems at my disposal for testing, I would like to figure out a way to determine the operating system of a remotely accessed Linux machine.
It seems pretty strange though, since cPanel reports both machines I am using as being
CENTOS Enterprise 4.5 i686, yet one's uname -a reports:
I'm assuming there is a way to determine the OS from this information. Anyone know how?
|
Posted by voxio, 11-15-2007, 12:31 AM | That information is your hostname and kernel version + arch and time when the kernel was built. Your distribution version (on a centos machine) can be found by using the following command:
cat /etc/redhat-release
|
Posted by HostSentry, 11-15-2007, 12:32 AM | What if it is not a redhat based OS?
Assuming I don't know what OS it is at all, just that its linux.
edit: Thanks for the help by the way
|
Posted by david510, 11-15-2007, 12:42 AM | It will be like /etc/redhat-release, /etc/debian_version, /etc/cobalt-release etc. You can issue this command to get the result.
cat /etc/*-release
|
Posted by HostSentry, 11-15-2007, 12:45 AM | Is there a list of possible files to find in the /etc directory? You list three there (which not all end in -release). Do you know any others?
|
Posted by david510, 11-15-2007, 12:46 AM | Did you try executing the command?
cat /etc/*-release
|
Posted by HoundOfTheSmith, 11-15-2007, 03:26 AM | Alternatively, try:
cat /etc/*release /etc/*version
(You'll get a particular volume of cruft too)
Oh, and the uname details such things as the kernel version, hostname etc. I'd expect those lines to differ between hosts and providers.
|
Posted by maestriatech, 11-15-2007, 03:48 AM | Try this:
cat /etc/issue
|
Posted by HostSentry, 11-15-2007, 12:36 PM | Thanks guys!
|
|
Add to Favourites
Print this Article |