I created a user using the useradd command. I’m attempting to give user2 (newly created) access to user1’s folder. I added user2 to the same group as user1 (using usermod -g), but when I attempt to change the home directory or open the directory, I get a “permission denied” message. This is my first attempt in trying this, so I assume I’m missing a step. What do I need to do to change a user’s home directory and gain permissions?
Share
Groups are only an “abstract concept” for create a set of permissions on a certain resource.
If you want to give
user2read permission aboveuser1home directory, and if you want to do this with groups, you have also to give at the whole group the+xpermission on that directory.So, you could do something like this:
chmod g+x /homeDirectoryOfUserA