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.
Before you go do all of that, verify that the permission changes aren't intentional. Some distributions will automatically change the owners of device files when a user logs in to allow that user to mount the device (like /dev/fd0, or cdrom drives, etc.). If you see the "owner" keyword in /etc/fstab for those devices, this is probably what's happening.
So log out with the new user, and log in with another, and check the ownerships of the devices. If they change to the current user logged in, then it'd be best to just leave them be; it's all being taken care of for you. If the deivices are still owned by the new user, then I can help you with a find command that will revert them back to root.
What happens if you have two users logged in at once then? I thought the whole point of groups was so that you didn't have to do something as silly as that.
And if you assign it to a different user each time they log in why not just give permissions to all users?
I'll check my fstab.. but if that is really happening then i think I'll need to change it.
Well, chances are slim you will have two users logged into the machine directly. I mean, there's only one keyboard, one mouse, one monitor... Users logged in from another location (via ssh, ftp, etc.) don't have physical access to the machine. It wouldn't make sense to give them mount capability for devices. The only way you could have two users logged in locally to the same system is through virtual terminals. I honestly don't know how that would be handled. It may be first-come-first-served... dunno.
I'm not saying I agree with this methodology, but there is logic behind it.
As for changing it, I'm not sure. My first guess would be to look for a file in /etc. Something like:
Code:
grep -lr "chown" /etc/*
Whatever it is that's changing ownership has to run after login, which means it's not a startup script (unless it's being run as a daemon). So that command may not turn up anything unless a shell script is used, or the configuration file is extremely straightforward.
Other than that, I'd check your distros website/faq/whatever. It might be addressed there.
No need for a script, you can do it with one command:
find . -user user1 -exec chgrp root {} \;
This will affect everyting in the default directory and its subdirectories recursively. There are numerous ways to add more selection criteria for the find command. Do 'man find' for details.
However, like was mentioned, if the device file ownerships are being changed at login, then that command will only last until someone else logs in. It's addressing the symptoms; not the cause.
I haven't found an answer but did come across a decent lead. I noticed Xzanron and theYinYeti show Mandrake 10 as their distribution.
I went to Mandrake's site to poke around. The FAQ didn't look like it would even come close to answering the question. Then, in the command-line documentation, there was a reference that Mandrake uses DevFS, and a link to an outside doc. Mandrake Document DevFS FAQ
There is a section named "Permissions persistence across reboots" and talks about a devfs configuration file. It sounds like it might be what you want, but I don't have devfs, and can't tinker with it to know for sure.
Like I said, it may not be the answer, but it's a decent place to start looking.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.