Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is it the nature of this info that's making it protected or is it the source code of these tools?
These tools lshw and dmidecode have source that is freely available.
The issue is that the information is being gathered using access to real memory (for example, from BIOS tables). Since having direct access to memory allows access to the whole system, it cannot be granted openly to user applications.
It is true that some of the information is not security critical, and in theory it could be made available to user programs (eg either by granting limited memory access rights, or indirectly through /proc). But in most cases anyone able to make use of this information has full access to the machine anyway.
Shall I start digging inside the source code of these tools to check if I could retrieve the baseboard product name without sudo or is there any other alternative.
In any case if this particular piece of info needs some kind of rights then I'll drop the idea of using it.
Shall I start digging inside the source code of these tools to check if I could retrieve the baseboard product name without sudo
No point, they probably just access /dev/mem.
I don't know of another way of getting this information from a non-privileged application. You can run lshw without sudo, and it will report as much as it can, but not the motherboard info from the BIOS.
I am relatively new in linux world. I don't know if it's common or restricted that when you install either open source or commercial apps and you have to assign some rights to their executable so that they can access private info, provided source of app is authenticated.
I don't know if it's common or restricted that when you install either open source or commercial apps and you have to assign some rights to their executable so that they can access private info, provided source of app is authenticated.
No, it isn't. For applications that come from a standard repository (eg the repository of the particular distribution), the installation process itself will normal take care of any access that is required. Some larger applications (such as a web server) may require some additional configuration, but most will work 'out of the box'. The bulk of applications simply operate at the user's privilege level.
For third party applications, installation can sometimes be a little more complex, since it may not be customized for the particular distribution.
If you find that an application does not have the access that you want, there is usually a good security reason for it. So although it is relatively easy in Linux to increase the privileges of an executable, it should only be done with great caution (and rarely if ever). Even if the application is known to be trustworthy, does not mean that you want it to have system wide access, since an untrusted user might misuse the application as a means of cracking the system (this is true whatever operating system you are running).
Last edited by neonsignal; 05-10-2011 at 09:03 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.