PDA

View Full Version : [ubuntu] Having a really hard time with groups.



Geran
June 6th, 2008, 02:37 PM
Hi,

I've been trying to set up groups properly for use, but I can't seem to get it right. Here's an example of what I'll do to open up a folder to a group and not to any user.




sudo mkdir something

sudo addgroup entry

sudo usermod -aGenty privilegeduser

sudo chgrp entry something

sudo chmod 770 something



Should be good for privilegeduser and all others in group entry, right? Well, it still returns this error.

bash: cd: something/: Permission denied.

So where am I going wrong?

Also, how can I list what groups a user is in and what users are in a group?

My OS is Hardy Heron.

nunki
June 6th, 2008, 03:52 PM
Hi,

I've been trying to set up groups properly for use, but I can't seem to get it right. Here's an example of what I'll do to open up a folder to a group and not to any user.




sudo mkdir something

sudo addgroup entry

sudo usermod -aGenty privilegeduser

sudo chgrp entry something

sudo chmod 770 something



Should be good for privilegeduser and all others in group entry, right? Well, it still returns this error.

bash: cd: something/: Permission denied.

So where am I going wrong?

Also, how can I list what groups a user is in and what users are in a group?

My OS is Hardy Heron.

?

sisco311
June 6th, 2008, 04:05 PM
Hi,

I've been trying to set up groups properly for use, but I can't seem to get it right. Here's an example of what I'll do to open up a folder to a group and not to any user.




sudo mkdir something

sudo addgroup entry

sudo usermod -aGenty privilegeduser

sudo chgrp entry something

sudo chmod 770 something

Should be good for privilegeduser and all others in group entry, right? Well, it still returns this error.

bash: cd: something/: Permission denied.

So where am I going wrong?

Also, how can I list what groups a user is in and what users are in a group?

My OS is Hardy Heron.

In order the usermod command take effect you need to log out and log in.

Use:

id
id usernameor

groups
groups usernameto list the groups.

HalPomeranz
June 6th, 2008, 05:03 PM
Also there's a typo in one of your commands:



sudo usermod -aGenty privilegeduser


Notice you typed "-aGenty" instead of "-aGentry" (dropped the 'r' in "entry").

sisco311
June 6th, 2008, 05:25 PM
The correct command is:

sudo usermod -aG entry privilegeduser
or

sudo usermod -a -G entry privilegeduser
or

sudo addgroup privilegeduser entry

-a = append
-G = group
entry = the group
privilegeduser = the user

Geran
June 6th, 2008, 08:14 PM
Thanks to all, I'll try that out.