I want every user to have full permissions over a single directory(and all the contents). Is this possible, and how? Thanks.
I want every user to have full permissions over a single directory(and all the contents). Is this possible, and how? Thanks.
You can get what you want to with adding users in particular group and then applying full permission to that group.
(echo $USER
& echo $LOGNAME
is helpful to get username and logname)
If/Let:
dir1
is directory to which you want to apply full permission to user,
user1
is user to which you want to give full permission,
group1
is existing or to be create for giving full permission.
Then following command-line information can help you:
group1
can be created using following command:
sudo addgroup group1
user1
can be added to group1
using following command:
sudo adduser pandya group1
Now permissions can be applied using following commands:
sudo chown :group1 -R dir1
sudo chmod g+rwx group1
sudo chown :group1 -R dir1
will apply group1
to dir1
recursively by -R
(to all sub directories and files)sudo chmod g+rwx group1
will apply read+write+execution permission to group1
user1
is in group1
so-that now user1
has full permission via group1
for dir1
recursively!$ ls -ld dir1
drwxrwxr-x 3 pandya group1 4096 Aug 3 12:11 example
where drwxrwxr-x
indicates d
for directory 1st rwx
for owner(u=pandya
) permission 2nd rwx
for group(g=group1
) permission and r-x
for other(o) permission in ugo
manner.