Re: [ilugd] which linux distro+release?
dear bhaskar, thanks a tonne for your email on all the methods you discovered so far to display the distribution and release version of a linux flavour thru a shell prompt. i tried each one of your options out, and discovered any one of them would work in snaring this data, though obviously i haven't do this for all 3xx distributions. as linux distros proliferate, and as new kind of devices, especially embedded linux devices spawn, i feel this question will become even more relevant. one small example: debian - knoppix - gnoppix - * with a couple of forks made by LiFY and a few by other education-based Live CD distros, which in turn could be forked by others . . . LL ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Here's some more information on identifying the linux distro which you guys might find helpful. The file /var/log/dmesg contains the info on the kernel, linux distro as well as the gcc version used to compile the kernel (provided the distro information was available when you compiled the kernel). Now, for the origin of this line of code: Try the command strings /boot/vmlinux-2.X.XX-XX | grep redhat on your redhat distribution. It will show the same output as can be seen in dmesg. So you see, the string is embedded in the kernel executable when you _compile_ the kernel. Now the catch is that when I compile the kernel, I can remove all instances of redhat ( or whatever, for that matter) from the source and replace it with another string. Then what?? The standard (dont think every release follows it) for identifying releases is lsb-release. It's documented in the LSB specification. You can see all the major releases follow the /etc/distro_name-version style nowadays. So unless you have played around, just ls /etc/*release should show you the file name containing your distro name name and release info. Anyways, kernel sources show that for certain redhat applications to run, the /etc/redhat-release file should be present, as it checks for an existing redhat installation. Same goes for /etc/slackware-version, /etc/SuSE-release, /etc/UnitedLinux-release, /etc/mandrake-release etc. These distros use these file info to lauch their custom apps. So if your sysadmin removes the files, some apps wdnt work. So running the strings... command and grepping for a particular distro should be able to show us the original distro used when the kernel was compiled. This can be simplified with a simple script to verify for all distros (there are more than 350 distros available, so listing them is another task!). For the webmin trick suggested by Raj, you can check the files /usr/libexec/webmin/os_list.txt as to how the detection works. For better info, check the file /usr/libexec/webmin/oschooser.pl. This script shows that the detection is done by reading /etc/.issue or /etc/issue (whichever is available) and doing uname -a. So you are back to square one if /etc/issue or /etc/.issue is removed. Then you better give the distro name and version manually to webmin or it wud do terrible things to ur system! Another thing to note is that knowing a distro isnt much help if you have recompiled the kernel several times and manually upgraded or changed most packages. Anyways, this is unimportant as all linux distros have the same basic kernel. Linus torvalds was quite clever in leaving the packaging part to others and just hackin on the kernel. All 350+ distros use the same kernels. So the dirty politics is not torvalds' responsibility. Why not leave it those who are already into it? If no distro info is found by any means, probably the system is made from scratch (!!!) check www.linuxfromscratch.org if you havent yet. Someone had talked about nmap and OS fingerprinting. I think remote fingerprinting an OS by checking banners or headers or flags etc does not look for distros. Knowing the versions of the running servers is quite enough to look for vulnerabilities. Browsing thru the nmap-hackers lists provide some valuable info. Fooling queso, nmap etc is possible. You can do it by adjusting HTTP headers, hacking the initial tcp sequence number generator in the kernel, changin the tcp window size, the default ttl of my ip packets etc. Another note on dmesg : as you compile the kernel using gcc, you get the version number in the output. sometimes you see Red Hat Linux 3.2.2-5 instead of Red Hat Linux 9.0 3.2.2-5. That's because the distro number could be found when the kernel was compiled. For the /proc/version stuff, check this:: /proc/sys/kernel/ or /proc/sys/ has the following files : ostype osrelease version which give info for /proc/version (these files exclude the matter in brackets generally). If you refer to /usr/src/linux-2.X/kernel/sysctl.c (lines 163-167) you will see that these files show info for the kernel only. If you have read till here, I hope your problems are solved. If you change /etc/issue or /etc/*-release, recompile the kernel and remove any distro information, you are basically left to yourself to maintain it; the upgradation process wont be possible (provided the system went to the moon for a face-lift ;-) ). But you can always play around with the kernel without such problems! Regards, Bhaskar. On Tuesday 16 Sep 2003 1:01 am, linuxlingam wrote: think i have finally found that command, though i need you guys to counter-check and verify it on your respective distributions of gnulinux. it occured to me through a throught that struck me watch a pc boot up wonder how they do so much branding of the distribution during boot up but never afterwards...?'
Re: [ilugd] which linux distro+release?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 LL == linuxlingam [EMAIL PROTECTED] writes: LL so you see this machine, with a shell prompt inviting you to LL punch away. question: LL you know its linux. but which distribution of linux? (knoppix, LL redhat, debian, slackware, mandrake...?) LL more importantly, which release of that particular linux LL distribution (Redhat 8, PCQLinuxX.x, Knoppix 3.2, Debian Woody LL 3.0.0r, etc?) LL so what's the magic bash command or sequence of commands? LL have done my googling for this and thumbed through some handy LL reference books. no luck. LL ? LL LL I'd suggested looking at Webmin source, which you didn't so I did :) The latest release of Webmin (1.110 or something) auto-detects the following OSs in /usr/libexec/webmin/os_list.txt: Sun Solaris Caldera OpenLinux eServer Caldera OpenLinux Redhat Linux Slackware Linux Debian Linux SuSE Linux United Linux Corel Linux TurboLinux Cobalt Linux Mandrake Linux Mandrake Linux Corporate Server Conectiva Linux ThizLinux Desktop ThizServer MSC Linux MkLinux LinuxPPC XLinux LinuxPL Trustix Cendio LBS Linux Ute Linux Lanthan Linux Yellow Dog Linux Corvus Latinux Immunix Linux Lycoris Desktop/LX Secure Linux FreeBSD OpenBSD NetBSD HP/UX SGI Irix DEC/Compaq OSF/1 IBM AIX SCO OpenServer Mac OS X / OS X Server Kaafi hai? :) Regards, - -- Raju - -- Raj Mathur[EMAIL PROTECTED] http://kandalaya.org/ GPG: 78D4 FC67 367F 40E2 0DD5 0FEF C968 D0EF CC68 D17F It is the mind that moves -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Processed by Mailcrypt 3.5.6 and Gnu Privacy Guard http://www.gnupg.org/ iD8DBQE/ZqgryWjQ78xo0X8RAjktAKCIjMFJsqyoNrCci2rTOhHk76IUDACfUJkd xY2fQw+FElJcjOWCTibfWOg= =xLsE -END PGP SIGNATURE- ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
On Tuesday, September 16, 2003 11:22 AM [GMT+0800], Arindam Dey [EMAIL PROTECTED] wrote: RedHat 9.0 [EMAIL PROTECTED] devil]$ dmesg | head -1 Linux version 2.4.20-20.9 ([EMAIL PROTECTED]) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Mon Aug 18 11:45:58 EDT 2003 Mandrake 9.1 [EMAIL PROTECTED] Z]$ dmesg | head -1 Linux version 2.4.21-0.13mdk ([EMAIL PROTECTED]) (gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)) #1 Fri Mar 14 15:08:06 EST 2003 To be exact, this is giving you the version of the gcc used to compile your running kernel, not the distro you are on _now_. -- Sanjeev ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
On Tue, 2003-09-16 at 17:35, Sanjeev Ghane Gupta wrote: Linux version 2.4.21-0.13mdk ([EMAIL PROTECTED]) (gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)) #1 Fri Mar 14 15:08:06 EST 2003 To be exact, this is giving you the version of the gcc used to compile your running kernel, not the distro you are on _now_. True but it lets you make an educated guess based on that line. But it is nothing compared to the webmin solution given by Raj Mathur in a previous mail. -- Arindam Dey The mind is not a vessel to be filled but a fire to be kindled. GPG FPR: B8E3 219E F129 F970 F4A7 BC50 9636 504A BEDF 5739 ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
What about /proc/version - isnt that supposed to give kernel version or something ? Mithun __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
dear raj, yes, i checked out webmin immediately after you mentioned it, but it works through a web-interface, and you ned to have it handy. my original question is simple: 'you have a shell prompt staring you on a linux-box. what's the magic sequence of commands to tell you which linux distro, and which version/release?' oth, the code of webmin could reveal how they do it for so many operating systems, distros, etc. meantime, sanjeev ghane's email on 'what is a distro' when i've taken it to the moon and back with updates and customization. . . . interestingly, dmesg on knoppix mentions debian. i suppose redhat is the only one that says if you make changes like with pcqlinux, any mention of redhat has to disappear throughout the distro .. . wonder what does gnoppix say on its origins? :-) LL ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
On Tuesday, September 16, 2003 8:52 PM [GMT+0800], linuxlingam [EMAIL PROTECTED] wrote: interestingly, dmesg on knoppix mentions debian. i suppose redhat is the only one that says if you make changes like with pcqlinux, any mention of redhat has to disappear throughout the distro .. . RedHat is very, very, explicit on this, and has made it clear it _will_ defend its Trade Name. You have been warned(tm) -- Sanjeev ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
original message from sharminder: is the uname command of any use here ? Try looking under /etc/ for some file named release or something ... U might also be able to peruse some info from some of the readymade scripts that come with the distro ... looking at the comments and all ... RPM and DEB based distros and Slackware are easily identifiable looking at the directory structure and general *feel* of the system. Should'nt be too difficult, though that depends on the amount of personal customisation that the system has gone through !! HTH Sharninder *** thanks sharminder, have already tried uname, with its various options, only tells you about the linux kernel, not the linux distribution. under /etc/ i may find the *.release file, which only exists if it is a red hat distribution. nothing of that nature for debian, therefore knoppix, etc etc. since the general 'feel' of a distribution can be heavily customized, this feature becomes all the more relevant. any other leads, anyone ? ? LL ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
thanks sharminder, have already tried uname, with its various options, only tells you about the linux kernel, not the linux distribution. under /etc/ i may find the *.release file, which only exists if it is a red hat distribution. nothing of that nature for debian, therefore knoppix, etc etc. since the general 'feel' of a distribution can be heavily customized, this feature becomes all the more relevant. try using nmap. It can fingerprint the OS, though that can be fooled too !! AFAI think, A slackware type system should be easy to identify, courtesy the difference in the boot scripts etc. A debian type system can be figured out by looking under /usr/local/share debian (and knoppix) i think keeps most of the package docs under /usr/local/share/doc/ ... while redhat keeps them under /usr/share/doc ... AFAIK .. as i said, if the system is really that obscure then you'll have to rely on your instincts and check the directory structure etc. for any clues. I would be interested in 'proper' solution to this one though !! Sharninder ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
On Mon, 2003-09-15 at 01:26, linuxlingam wrote: more importantly, which release of that particular linux distribution (Redhat 8, PCQLinuxX.x, Knoppix 3.2, Debian Woody 3.0.0r, etc?) You can also try less /etc/issue (This hint courtsey Thomas Adam The Linux Weekend Mechanic of www.linuxgazette.com) -- / \__ (@\___Raj Shekhar / O http://geocities.com/lunatech3007/ / (_/ /_/ U ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, Sep 16, 2003 at 01:01:48AM +0530, linuxlingam wrote: linuxlingamthink i have finally found that command, though i need you guys to linuxlingamcounter-check and verify it on your respective distributions of gnulinux. linuxlingam linuxlingamit occured to me through a throught that struck me watch a pc boot up linuxlingamwonder how they do so much branding of the distribution during boot up but linuxlingamnever afterwards...?' try /etc/issue or /etc/issue.net works in most of the distros but is very easy to be modified by the sys ad. but most people let it be the way it is. - -- all the things we keep inside, are the things that really matter, the face puts on its best disguise, and all is well, until the heart betrays. -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/ZiFG7v3NbZTFJeIRAvN3AKCJU/XQtx56gZDWdkqVndsMRfVC6gCfTnco ToWKJx627hu54x7e3qtz5PE= =3NGx -END PGP SIGNATURE- ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
[ilugd] which linux distro+release?
so you see this machine, with a shell prompt inviting you to punch away. question: you know its linux. but which distribution of linux? (knoppix, redhat, debian, slackware, mandrake...?) more importantly, which release of that particular linux distribution (Redhat 8, PCQLinuxX.x, Knoppix 3.2, Debian Woody 3.0.0r, etc?) so what's the magic bash command or sequence of commands? have done my googling for this and thumbed through some handy reference books. no luck. ? LL ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] which linux distro+release?
is the uname command of any use here ? Try looking under /etc/ for some file named release or something ... U might also be able to peruse some info from some of the readymade scripts that come with the distro ... looking at the comments and all ... RPM and DEB based distros and Slackware are easily identifiable looking at the directory structure and general *feel* of the system. Should'nt be too difficult, though that depends on the amount of personal customisation that the system has gone through !! HTH Sharninder Cry on someone else's shoulder, I'm off-duty. - Troi so you see this machine, with a shell prompt inviting you to punch away. question: you know its linux. but which distribution of linux? (knoppix, redhat, debian, slackware, mandrake...?) more importantly, which release of that particular linux distribution (Redhat 8, PCQLinuxX.x, Knoppix 3.2, Debian Woody 3.0.0r, etc?) so what's the magic bash command or sequence of commands? have done my googling for this and thumbed through some handy reference books. no luck. ? LL ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd