Glam Prestige Journal

Bright entertainment trends with youth appeal.

I want to implement this--

The owner of the folder Work is John. There is another user called Rebeka . [I am the administrator. Both John and Rebeka are standard users (which I created via Terminal)]

Does John automatically have full permission for the folder and it's files as he is the owner?

I want to give Rebeka full permission on the folder Work and it's files, but still the owner will be John, not Rebeka. So, both John and Rebeka will have full permission on the folder Work.

Are the above possible to implement using Terminal? If yes, what will be the command lines?

[P.S: I am using Ubuntu 14.04.5 LTS ]

1

2 Answers

Yes, the owner of file would have full access. To be exact, owner has access to specify permission levels on the files/ folders, for himself, group and all-others.

I could think of the following steps to solve your scenario.

Create a new group:

sudo groupadd <group name>

Add both users to the group using

sudo usermod -a -G <group name> <user name>

Change group of folder:

chgrp <folder name> <group name> Note: use -hR to set this for all files and directories within

Change permission of the folder:

chmod 770 <folder name>

Essentially this should give full permission rwx to owner(7) and group(7) and no access for all(0). Make sure that the group only has members who need to access the folder. In case you want to add or remove users later, just modify the group.

4

chown can be used to set owner and group for files and folders.
chmod can be used to set permissions.
addgroup --system and adduser can be used to create user groups

Examples

chown John:Rebeka file #this sets John as owner and Rebeka's group as group
chmod 774 file #this gives owner and group full permission, and others read only permission
addgroup -system workgroup #this creates the group 'workgroup' with no members
adduser Rebeka workgroup #this adds Rebeka to the group workgroup

Reference


Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy