Linux - KernelThis forum is for all discussion relating to the Linux kernel.
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.
well according to "linux in a nutshell" the developer/user should never configure and compile the kernel source under root , however when i try to compile the latest version i get permission errors forcing me to use root...
so what to do ? ignore the warning from that book or what ?
The usual path I always take to kernel (or other software) compilation is (simply):
- download the kernel/software as regular user
- unpack un the regular folder
- make configure
- make
- as root make install
Safe from the install, it is unwise to compile as Root. Not just a kernel but any software. Some reasons are that Root's folder is in an other partition altogether (mine is anyway) and an other reason is that any "intrusive" code can be detected without tampering with the system as a whole.
Some possible ideas rise here. Either you have done some extensive stuff as Root (installations and useage of) and have in effect two sets of working permissions. Try to find out what the system asks from you. Is it access to a shared section Root only has rights to? Does the regular user even have the needed permissions? Should'nt you re-install some stuff with the proper rights?
I'll be watching this (interesting) thread to see where it ends up...
well according to "linux in a nutshell" the developer/user should never configure and compile the kernel source under root , however when i try to compile the latest version i get permission errors forcing me to use root...
so what to do ? ignore the warning from that book or what ?
cheers
You don't need such kind of privileges to compile the kernel. So, my guess is that you download the kernel as root, or uncompressed it as root, or installed it using your package manager. In any of these cases, the kernel sources will probably be owned by root, and stored into a location where regular users can't write.
So, my advice is to just download it as a regular user, into your home directory, ucompress it as a regular user, and compile it as a regular user. Then just do this to install it:
Code:
su -c 'make install modules_install'
And give the root password when asked.
Otherwise, just use whatever method your distro says you should be using to compile your kernel as root. But I personally see no reason to operate as root for such kind of task. The less you use root, the more limited that the scope of any possible damage will be if you commit an error.
Hi, Either you have done some extensive stuff as Root (installations and usage of) and have in effect two sets of working permissions
well yes i use root most of the time ...if not always.
what do you mean by 2 sets of working permissions ?
please explain ..
Quote:
So, my guess is that you download the kernel as root, or uncompressed it as root, or installed it using your package manager. In any of these cases, the kernel sources will probably be owned by root, and stored into a location where regular users can't write.
well not quite right , actually i've downloaded the source as root however i've quickly changed the owner and group ids to a normal user then i've placed it into a new directory owned by the same user and then SUed into that user and untarred the source and attempted to run "make config".
btw , i've discovered what went wrong an that is , the new directory which contained the tarball as well as the source itself (although they both had normal user ownerships) they were still under the root working directory for convenience (i.e /root/Desktop/normal-user-dir/linux.2.6.xx) so i moved the folder altogether into the home directory of the normal user and now it works .... oh stupid me
well yes i use root most of the time ...if not always.
what do you mean by 2 sets of working permissions ?
Well, I won't try to evangelize here. They're well known, the reasons why you shouldn't do that. There's enough of that in the net in case no one already told you that yet.
well not quite right , actually i've downloaded the source as root however i've quickly changed the owner and group ids to a normal user then i've placed it into a new directory owned by the same user and then SUed into that user and untarred the source and attempted to run "make config".
btw , i've discovered what went wrong an that is , the new directory which contained the tarball as well as the source itself (although they both had normal user ownerships) they were still under the root working directory for convenience (i.e /root/Desktop/normal-user-dir/linux.2.6.xx) so i moved the folder altogether into the home directory of the normal user and now it works .... oh stupid me
Well, I was just guessing, since I hadn't much info to play with. Anyway, it scapes the limits of my comprehension why would anyone put a directory owned by a regular user under /root. There's a reason why the root home directory is not even under /home/, like the rest of home directories. To access a given path you need permissions to access all the upper levels, which implies compromising the privacy of the root user by granting at least +x for all the users into /root/.
Well, I won't try to evangelize here. They're well known, the reasons why you shouldn't do that. There's enough of that in the net in case no one already told you that yet.
Well, I was just guessing, since I hadn't much info to play with. Anyway, it scapes the limits of my comprehension why would anyone put a directory owned by a regular user under /root. There's a reason why the root home directory is not even under /home/, like the rest of home directories. To access a given path you need permissions to access all the upper levels, which implies compromising the privacy of the root user by granting at least +x for all the users into /root/.
well it's not that "no one" has told me about not running as root , it's that i don't really care ...besides running as a normal user on a desktop system is a PITA.
anyways that's beyond this discussion ...
as for your inability to comprehend why i did place that dir (owned by regular users) under /root , well i'd already said it's for convenience , btw the root directory was never compromised at any point in time , did I it mention that i'm the ONLY user on my system?
It doesn't mind you are the only user on your system. That's the case as well in most Windows based PC's, and we all know what happens to them. Any threat will have as much privileges as the active user it runs under. If you run Firefox as root any stupid porn site can blow up your system. But, as you very well said, that's out of the discussion. Sorry for being off-topic, but when I suggest someone to do something in a support forum I want to know that s/he knows at least the implication of the wrong things s/he's doing. I think it's a legitimate course of action.
If you run Firefox as root any stupid porn site can blow up your system.
well yes theoretically that's true but strangely enough in the last 4 years since i've started using linux that never actually happened , not that i don't visit stupid porn sites though
anyways , i guess you brought me to a new idea regarding security (not that it's needed but just as an extra check) namely modify the Desktop launcher for firefox to something like
Code:
su user -c "firefox %f"
.
to be honest , i've thinking about a way to find a new compromise between convenience and security , that's definitely an approach worth researching in the distro that i'm building ..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.