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.
I was wondering what is a good permission set to put on the /usr/src directory? I can't do anything inside that directory now unless I am root. However, I want to be able to compile the kernel and when I do make menuconfig I don't have the permissions for it. Are there any suggestions for this problem?
its just a general directory, so i wouldn't be overly scared to set high permissions
like
777
that way everyone can use that directory, but id probably suggest maybe setting tighter permissions on certain files/folders in that directory that are important
When dealing with permissions, my "motto" per se is:
Use as strict a set of permissions as you can to perform your desired function.
So, I personally wouldn't set a 777 on just about anything on my system. Instead, in the case of kernel compiling in /usr/src I'd instead create me a "compile" or "kernel" group:
groupadd kernel
And then add my user to this group:
usermod -G kernel masterc
And then chown the directory to that group:
chown -R root.kernel /usr/src
And finally, ensure the chmod matched that for proper execution:
chmod 750 /usr/src
And then from that point on, whatever users I wanted to allow to compile a kernel I'd simply have to add them to the kernel group.
It may seem extensive and some may consider it a bit of overkill, especially for something in /usr/src however it's what I would consider the "proper" way as permissions are certainly something linux excels in that other OS don't.
Good suggestions guys, as always thanks for the help! I have went ahead and done as you suggested, creating a kernel compiling group. I actually already did that just wasn't sure about how to use the chown in the correct way.
Well, I have to agree with setting conservative permissions. Setting a system directory to 777 can be dangerous and should best be avoided. Also, Linus recommends strongly against compiling a kernel in /usr/src. I always compile a kernel in my /home directory, that way permissions are not an issue at all except to do make menu_config, and installing the actual kernel. There are other reasons for not compiling a kernel in /usr/src, but they don't come to mind at the moment. Check out www.kernel.org, or http://kerneltrap.org/ for more info.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.