How to give permissions to a subfolder while denying access to folders above it

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have this structure:
/home/the_user/folder/subfolder
and I would like to have read and write access to it, but I want to be unable to read or write anything above it, that is
/home/the_user/folder
Is that possible?
permissions chmod
add a comment |Â
up vote
0
down vote
favorite
I have this structure:
/home/the_user/folder/subfolder
and I would like to have read and write access to it, but I want to be unable to read or write anything above it, that is
/home/the_user/folder
Is that possible?
permissions chmod
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have this structure:
/home/the_user/folder/subfolder
and I would like to have read and write access to it, but I want to be unable to read or write anything above it, that is
/home/the_user/folder
Is that possible?
permissions chmod
I have this structure:
/home/the_user/folder/subfolder
and I would like to have read and write access to it, but I want to be unable to read or write anything above it, that is
/home/the_user/folder
Is that possible?
permissions chmod
asked Apr 11 at 23:53
Mephisto
261112
261112
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
It's better to do this in a location other than home such as creating the folder structure in / but here it goes:
Set the owner of subfolder as the user you want to have read and write permissions.
chown user /home/the_user/folder/subfolder
chmod u+rwx /home/the_user/folder/subfolder
Set execute for others on /home the_user and folder and make sure that there is no read and write for the user.
chmod +x for each of them and chmod -rw for the user.
That will allow the user to traverse the above directories but not read them or write to them while allowing him to read and write to subfolder.
Once again, I recommend against doing this in /home and suggest that you create the directory as a subfolder of root such as:
mkdir /mnt/folder
....and use my answer there instead of potentially making a mistake and giving permissions to someone's home directory.
No, this is wrong. Withxpermissions on/home/the_user/folder, you can access the files in it as their permissions permit. You can't list the directory contents, but if you know our guess the name of a file, you can check whether it exists, and can access it subject to that file's permissions.
â Gilles
Apr 12 at 7:46
My answer isn't wrong. It just doesn't cover every possible scenario which can be said of many of the answers in Stack Exchange especially when it comes to access and user rights. The one flaw is that a user can guess a filename in one of the higher folders and see that it exists by usinglson the file itself but he still can't access it unless he has permissions. As the OP doesn't want that, it's up to him to make sure that the permissions don't allow that access. My answer doesn't allow him to list the directory contents for the higher directories so it effectively does what he wants.
â Nasir Riley
Apr 12 at 13:31
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
It's better to do this in a location other than home such as creating the folder structure in / but here it goes:
Set the owner of subfolder as the user you want to have read and write permissions.
chown user /home/the_user/folder/subfolder
chmod u+rwx /home/the_user/folder/subfolder
Set execute for others on /home the_user and folder and make sure that there is no read and write for the user.
chmod +x for each of them and chmod -rw for the user.
That will allow the user to traverse the above directories but not read them or write to them while allowing him to read and write to subfolder.
Once again, I recommend against doing this in /home and suggest that you create the directory as a subfolder of root such as:
mkdir /mnt/folder
....and use my answer there instead of potentially making a mistake and giving permissions to someone's home directory.
No, this is wrong. Withxpermissions on/home/the_user/folder, you can access the files in it as their permissions permit. You can't list the directory contents, but if you know our guess the name of a file, you can check whether it exists, and can access it subject to that file's permissions.
â Gilles
Apr 12 at 7:46
My answer isn't wrong. It just doesn't cover every possible scenario which can be said of many of the answers in Stack Exchange especially when it comes to access and user rights. The one flaw is that a user can guess a filename in one of the higher folders and see that it exists by usinglson the file itself but he still can't access it unless he has permissions. As the OP doesn't want that, it's up to him to make sure that the permissions don't allow that access. My answer doesn't allow him to list the directory contents for the higher directories so it effectively does what he wants.
â Nasir Riley
Apr 12 at 13:31
add a comment |Â
up vote
0
down vote
It's better to do this in a location other than home such as creating the folder structure in / but here it goes:
Set the owner of subfolder as the user you want to have read and write permissions.
chown user /home/the_user/folder/subfolder
chmod u+rwx /home/the_user/folder/subfolder
Set execute for others on /home the_user and folder and make sure that there is no read and write for the user.
chmod +x for each of them and chmod -rw for the user.
That will allow the user to traverse the above directories but not read them or write to them while allowing him to read and write to subfolder.
Once again, I recommend against doing this in /home and suggest that you create the directory as a subfolder of root such as:
mkdir /mnt/folder
....and use my answer there instead of potentially making a mistake and giving permissions to someone's home directory.
No, this is wrong. Withxpermissions on/home/the_user/folder, you can access the files in it as their permissions permit. You can't list the directory contents, but if you know our guess the name of a file, you can check whether it exists, and can access it subject to that file's permissions.
â Gilles
Apr 12 at 7:46
My answer isn't wrong. It just doesn't cover every possible scenario which can be said of many of the answers in Stack Exchange especially when it comes to access and user rights. The one flaw is that a user can guess a filename in one of the higher folders and see that it exists by usinglson the file itself but he still can't access it unless he has permissions. As the OP doesn't want that, it's up to him to make sure that the permissions don't allow that access. My answer doesn't allow him to list the directory contents for the higher directories so it effectively does what he wants.
â Nasir Riley
Apr 12 at 13:31
add a comment |Â
up vote
0
down vote
up vote
0
down vote
It's better to do this in a location other than home such as creating the folder structure in / but here it goes:
Set the owner of subfolder as the user you want to have read and write permissions.
chown user /home/the_user/folder/subfolder
chmod u+rwx /home/the_user/folder/subfolder
Set execute for others on /home the_user and folder and make sure that there is no read and write for the user.
chmod +x for each of them and chmod -rw for the user.
That will allow the user to traverse the above directories but not read them or write to them while allowing him to read and write to subfolder.
Once again, I recommend against doing this in /home and suggest that you create the directory as a subfolder of root such as:
mkdir /mnt/folder
....and use my answer there instead of potentially making a mistake and giving permissions to someone's home directory.
It's better to do this in a location other than home such as creating the folder structure in / but here it goes:
Set the owner of subfolder as the user you want to have read and write permissions.
chown user /home/the_user/folder/subfolder
chmod u+rwx /home/the_user/folder/subfolder
Set execute for others on /home the_user and folder and make sure that there is no read and write for the user.
chmod +x for each of them and chmod -rw for the user.
That will allow the user to traverse the above directories but not read them or write to them while allowing him to read and write to subfolder.
Once again, I recommend against doing this in /home and suggest that you create the directory as a subfolder of root such as:
mkdir /mnt/folder
....and use my answer there instead of potentially making a mistake and giving permissions to someone's home directory.
edited Apr 12 at 12:23
answered Apr 12 at 0:55
Nasir Riley
1,514138
1,514138
No, this is wrong. Withxpermissions on/home/the_user/folder, you can access the files in it as their permissions permit. You can't list the directory contents, but if you know our guess the name of a file, you can check whether it exists, and can access it subject to that file's permissions.
â Gilles
Apr 12 at 7:46
My answer isn't wrong. It just doesn't cover every possible scenario which can be said of many of the answers in Stack Exchange especially when it comes to access and user rights. The one flaw is that a user can guess a filename in one of the higher folders and see that it exists by usinglson the file itself but he still can't access it unless he has permissions. As the OP doesn't want that, it's up to him to make sure that the permissions don't allow that access. My answer doesn't allow him to list the directory contents for the higher directories so it effectively does what he wants.
â Nasir Riley
Apr 12 at 13:31
add a comment |Â
No, this is wrong. Withxpermissions on/home/the_user/folder, you can access the files in it as their permissions permit. You can't list the directory contents, but if you know our guess the name of a file, you can check whether it exists, and can access it subject to that file's permissions.
â Gilles
Apr 12 at 7:46
My answer isn't wrong. It just doesn't cover every possible scenario which can be said of many of the answers in Stack Exchange especially when it comes to access and user rights. The one flaw is that a user can guess a filename in one of the higher folders and see that it exists by usinglson the file itself but he still can't access it unless he has permissions. As the OP doesn't want that, it's up to him to make sure that the permissions don't allow that access. My answer doesn't allow him to list the directory contents for the higher directories so it effectively does what he wants.
â Nasir Riley
Apr 12 at 13:31
No, this is wrong. With
x permissions on /home/the_user/folder, you can access the files in it as their permissions permit. You can't list the directory contents, but if you know our guess the name of a file, you can check whether it exists, and can access it subject to that file's permissions.â Gilles
Apr 12 at 7:46
No, this is wrong. With
x permissions on /home/the_user/folder, you can access the files in it as their permissions permit. You can't list the directory contents, but if you know our guess the name of a file, you can check whether it exists, and can access it subject to that file's permissions.â Gilles
Apr 12 at 7:46
My answer isn't wrong. It just doesn't cover every possible scenario which can be said of many of the answers in Stack Exchange especially when it comes to access and user rights. The one flaw is that a user can guess a filename in one of the higher folders and see that it exists by using
lson the file itself but he still can't access it unless he has permissions. As the OP doesn't want that, it's up to him to make sure that the permissions don't allow that access. My answer doesn't allow him to list the directory contents for the higher directories so it effectively does what he wants.â Nasir Riley
Apr 12 at 13:31
My answer isn't wrong. It just doesn't cover every possible scenario which can be said of many of the answers in Stack Exchange especially when it comes to access and user rights. The one flaw is that a user can guess a filename in one of the higher folders and see that it exists by using
lson the file itself but he still can't access it unless he has permissions. As the OP doesn't want that, it's up to him to make sure that the permissions don't allow that access. My answer doesn't allow him to list the directory contents for the higher directories so it effectively does what he wants.â Nasir Riley
Apr 12 at 13:31
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f437162%2fhow-to-give-permissions-to-a-subfolder-while-denying-access-to-folders-above-it%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password