Home » Questions » Computers [ Ask a new question ]

Groups issue on Ubuntu

Groups issue on Ubuntu

I am member of couple of groups lets say Master, Student, Web. The problem is that by default whatever I do is first created under student group. I need to set it so it is created with Web group.

Asked by: Guest | Views: 40
Total answers/comments: 1
Guest [Entry]

"If you want to permanently change the user's default group, use usermod (manpage):

# set ""web"" as the primary group for user ""username""
$ sudo usermod -g web username

Or, you can put newgrp web (or whatever the group name is) in your .bashrc, somewhere near the end of the file, to get ""logged into"" the Web group each time you login -- without changing your user's primary group. newgrp (manpage) sets the ""effective group ID"". Watch:

# what's my current effective GID?
$ id -g
1000

# ""login"" to another group
$ newgrp www-data

# now what's my effective GID?
$ id -g
33"