Trying to Add Users to Newly Created Group (Red Hat version)
I have just created a new group and would like to add existing users to the new group. I've already changed the ownership of the files to myself in the newly created group. I want to do this because the information in the files is very sensitive and I want to limit access to the files to members of the new group only. It seems to me, intuitively, that one may either be able to change ownership of the files to a group but not a particular user, or add users to the restricted group and they will automatically have access to the files. I will greatly appreciate any assistance any one can provide.
Hi there is several ways to do this but this is one way:
Check what groups the user is already in.
root#: groups username
tty wheel audio users
This will tell you the groups that username belongs to.
In this case tty wheel audio and users.
To add this user to the group "secret"
do the following as root:
root#: usermod -G tty,wheel,audio,users,secret username
This would add username to the secret group and leave them in the groups they were already in.
Then remember to set the permissions properly for the file(s) you want to give group access to.
root#: chgrp secret filename
root#: chmod 660 filename
Hope this helps.
|All times are GMT -5. The time now is 08:35 PM.|