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'm running slackware 13.0. I've created a folder called "slackware"
that I'm trying to make shareable shareable by everyone in the group
called "packager".
I added myself and root to the group "packager":
usermod -G packager root
usermod -G packager chytraeus
If i set the permissions to 2777 i can create a file just fine:
I see:
users lp wheel floppy audio video cdrom plugdev power netdev scanner
Here is the output on the directory permissions:
chytraeus@leo:~$ ls -ld /home/slackware/
drwxrws--- 4 nobody packager 4096 2010-01-25 20:53 /home/slackware//
So you did. I notice now that you said so in your original post.
'usermod -G' sets, not appends to, your supplementary group list. The command 'usermod -G packager chytraeus' made packager your only supplementary group. To append to the list you need to use '-Ga' instead of '-G'. In order to restore root's and your proper group memberships, run the following commands. '<groups>' will need to be replaced with root's proper group list, see below.
You got different results from the two calls to id because 'id -Gn' queries your effective group membership whereas 'id -Gn chytraeus' queries your membership in /etc/group. Your group membership is only refreshed from /etc/group when you log in, so your effective membership was what it had been before reconfiguration. If you have a root shell that's been logged in since before the reconfiguration you can recover root's proper group membership by querying its effective group list. If you don't, tell me and I'll fire up my Slack13 VM and look it up for you.
Once you log in again your effective group membership will match that in /etc/group and your permissions problem should go away. Remember not to exit your current shell before you restore your proper group list or you may not have the permissions required to do so.
So you did. I notice now that you said so in your original post.
'usermod -G' sets, not appends to, your supplementary group list. The command 'usermod -G packager chytraeus' made packager your only supplementary group. To append to the list you need to use '-Ga' instead of '-G'.
Okay, slackware's usermod lacks the -a option.
Quote:
In order to restore root's and your proper group memberships, run the following commands. '<groups>' will need to be replaced with root's proper group list, see below.
You got different results from the two calls to id because 'id -Gn' queries your effective group membership whereas 'id -Gn chytraeus' queries your membership in /etc/group. Your group membership is only refreshed from /etc/group when you log in, so your effective membership was what it had been before reconfiguration. If you have a root shell that's been logged in since before the reconfiguration you can recover root's proper group membership by querying its effective group list. If you don't, tell me and I'll fire up my Slack13 VM and look it up for you.
Querying root's groups shows the following:
Code:
root@leo:/home/slackware# id -Gn
root
root@leo:/home/slackware# id
uid=0(root) gid=0(root) groups=0(root)
not sure if the results from id are as they should be - don't know what groups root should belong to.
Quote:
Once you log in again your effective group membership will match that in /etc/group and your permissions problem should go away. Remember not to exit your current shell before you restore your proper group list or you may not have the permissions required to do so.
If your usermod lacks '-Ga' you should use 'gpasswd -a <user> <group>' instead. This is probably a better way than 'usermod -Ga' anyway, as gpasswd is the tool used for most group maintenance.
On my Gentoo system root has group membership 'root bin daemon sys adm disk wheel floppy dialout tape video'. This is probably wrong for your Slack13 system, just showing that root usually belongs to more groups than just 'root'. Give me a minute and I'll boot up my Slack13 VM and post root's default group membership for you.
Okay, on Slack13 root's proper group membership is 'root bin daemon sys adm disk wheel floppy audio video cdrom tape plugdev power netdev scanner'.
So the command to restore it (with the new group) is 'usermod -G root,bin,daemon,sys,adm,disk,wheel,floppy,audio,video,cdrom,tape,plugdev,power,netdev,scanner,packag er root'.
EDIT: Apparently there's something wrong with the forum software. I'm seeing a space before the 'er' in 'packager' in the post but not in the edit box. The space shouldn't be there.
Last edited by Elemecca; 01-27-2010 at 02:13 AM.
Reason: See EDIT: line.
Okay, on Slack13 root's proper group membership is 'root bin daemon sys adm disk wheel floppy audio video cdrom tape plugdev power netdev scanner'.
So the command to restore it (with the new group) is 'usermod -G root,bin,daemon,sys,adm,disk,wheel,floppy,audio,video,cdrom,tape,plugdev,power,netdev,scanner,packag er root'.
EDIT: Apparently there's something wrong with the forum software. I'm seeing a space before the 'er' in 'packager' in the post but not in the edit box. The space shouldn't be there.
Alright, users are with their correct groups and I can now write to /home/slackware.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.