permission denied for reading directory owned by the same user
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have two users on a Ubuntu machine. One of them is in sudoers list, while the other is not. I create a directory in first user's home directory. Then I change the ownership of this directory to the other user. Now when I switch to the other user and try to read this directory, it says permission denied.
I used chown
with -R
so it applied to everything inside the directory.
The ls -l
shows this
drwxr-xr-x 2 lfs lfs 4096 Mar 23 02:07 sources
lfs
being the second user.
linux ubuntu
add a comment |Â
up vote
0
down vote
favorite
I have two users on a Ubuntu machine. One of them is in sudoers list, while the other is not. I create a directory in first user's home directory. Then I change the ownership of this directory to the other user. Now when I switch to the other user and try to read this directory, it says permission denied.
I used chown
with -R
so it applied to everything inside the directory.
The ls -l
shows this
drwxr-xr-x 2 lfs lfs 4096 Mar 23 02:07 sources
lfs
being the second user.
linux ubuntu
2
Does the parent directories of the "source" directory have execute permissions for the other user?
â Kusalananda
Mar 23 at 14:13
Concur with @Kusalananda - check the entire tree leading up to that directory. Chances are that's why you're getting locked out.
â Shadur
Mar 25 at 19:43
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have two users on a Ubuntu machine. One of them is in sudoers list, while the other is not. I create a directory in first user's home directory. Then I change the ownership of this directory to the other user. Now when I switch to the other user and try to read this directory, it says permission denied.
I used chown
with -R
so it applied to everything inside the directory.
The ls -l
shows this
drwxr-xr-x 2 lfs lfs 4096 Mar 23 02:07 sources
lfs
being the second user.
linux ubuntu
I have two users on a Ubuntu machine. One of them is in sudoers list, while the other is not. I create a directory in first user's home directory. Then I change the ownership of this directory to the other user. Now when I switch to the other user and try to read this directory, it says permission denied.
I used chown
with -R
so it applied to everything inside the directory.
The ls -l
shows this
drwxr-xr-x 2 lfs lfs 4096 Mar 23 02:07 sources
lfs
being the second user.
linux ubuntu
edited Mar 23 at 14:44
Andy Dalton
4,7561520
4,7561520
asked Mar 23 at 13:43
Akash Garg
31
31
2
Does the parent directories of the "source" directory have execute permissions for the other user?
â Kusalananda
Mar 23 at 14:13
Concur with @Kusalananda - check the entire tree leading up to that directory. Chances are that's why you're getting locked out.
â Shadur
Mar 25 at 19:43
add a comment |Â
2
Does the parent directories of the "source" directory have execute permissions for the other user?
â Kusalananda
Mar 23 at 14:13
Concur with @Kusalananda - check the entire tree leading up to that directory. Chances are that's why you're getting locked out.
â Shadur
Mar 25 at 19:43
2
2
Does the parent directories of the "source" directory have execute permissions for the other user?
â Kusalananda
Mar 23 at 14:13
Does the parent directories of the "source" directory have execute permissions for the other user?
â Kusalananda
Mar 23 at 14:13
Concur with @Kusalananda - check the entire tree leading up to that directory. Chances are that's why you're getting locked out.
â Shadur
Mar 25 at 19:43
Concur with @Kusalananda - check the entire tree leading up to that directory. Chances are that's why you're getting locked out.
â Shadur
Mar 25 at 19:43
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
This is a follow-up to @Kusalananda 's question in the comment associated with your question above.
Suppose that you have two users, user1
and user2
. Suppose that user1
has a home directory /home/user1
. Now suppose that in the home directory of user1
you create a directory owned by user2
, say /home/user1/sources
, can user2
access that directory?
In order for user2
to be able to access /home/user1/sources
, then user2
needs to have x
(traverse) permission on each directory from root, up to and including the sources
directory:
$ ls -ld /
dr-xr-xr-x 31 root root 4096 Feb 28 11:37 /
^ Check (this will almost always be OK)
$ ls -ld /home
drwxr-xr-x 4 root root 4096 Feb 28 11:38 /home
^ Check (this will almost always be OK)
$ ls -ld /home/user1
drwx------ 9 user1 group1 4096 Mar 21 00:36 /home/user1
^ ^ In this case, no, user2 cannot traverse here
$ ls -ld /home/user1/sources
drwxr-xr-x 9 user2 group2 4096 Mar 21 00:36 /home/user1/sources
^ Check
In this example, because user2
cannot traverse into /home/user1
, user2
cannot access /home/user1/sources
(even though user2
owns that directory).
In your question you said that the sources
directory is in the home directory of the first user. My guess is that the second user can't access the first user's home directory.
You might consider putting the sources
directory somewhere outside of the user's home directory.
Thank you. :) i had to use /mnt to create the sources for user lfs to be able to read.
â Akash Garg
Mar 27 at 1:45
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
This is a follow-up to @Kusalananda 's question in the comment associated with your question above.
Suppose that you have two users, user1
and user2
. Suppose that user1
has a home directory /home/user1
. Now suppose that in the home directory of user1
you create a directory owned by user2
, say /home/user1/sources
, can user2
access that directory?
In order for user2
to be able to access /home/user1/sources
, then user2
needs to have x
(traverse) permission on each directory from root, up to and including the sources
directory:
$ ls -ld /
dr-xr-xr-x 31 root root 4096 Feb 28 11:37 /
^ Check (this will almost always be OK)
$ ls -ld /home
drwxr-xr-x 4 root root 4096 Feb 28 11:38 /home
^ Check (this will almost always be OK)
$ ls -ld /home/user1
drwx------ 9 user1 group1 4096 Mar 21 00:36 /home/user1
^ ^ In this case, no, user2 cannot traverse here
$ ls -ld /home/user1/sources
drwxr-xr-x 9 user2 group2 4096 Mar 21 00:36 /home/user1/sources
^ Check
In this example, because user2
cannot traverse into /home/user1
, user2
cannot access /home/user1/sources
(even though user2
owns that directory).
In your question you said that the sources
directory is in the home directory of the first user. My guess is that the second user can't access the first user's home directory.
You might consider putting the sources
directory somewhere outside of the user's home directory.
Thank you. :) i had to use /mnt to create the sources for user lfs to be able to read.
â Akash Garg
Mar 27 at 1:45
add a comment |Â
up vote
2
down vote
accepted
This is a follow-up to @Kusalananda 's question in the comment associated with your question above.
Suppose that you have two users, user1
and user2
. Suppose that user1
has a home directory /home/user1
. Now suppose that in the home directory of user1
you create a directory owned by user2
, say /home/user1/sources
, can user2
access that directory?
In order for user2
to be able to access /home/user1/sources
, then user2
needs to have x
(traverse) permission on each directory from root, up to and including the sources
directory:
$ ls -ld /
dr-xr-xr-x 31 root root 4096 Feb 28 11:37 /
^ Check (this will almost always be OK)
$ ls -ld /home
drwxr-xr-x 4 root root 4096 Feb 28 11:38 /home
^ Check (this will almost always be OK)
$ ls -ld /home/user1
drwx------ 9 user1 group1 4096 Mar 21 00:36 /home/user1
^ ^ In this case, no, user2 cannot traverse here
$ ls -ld /home/user1/sources
drwxr-xr-x 9 user2 group2 4096 Mar 21 00:36 /home/user1/sources
^ Check
In this example, because user2
cannot traverse into /home/user1
, user2
cannot access /home/user1/sources
(even though user2
owns that directory).
In your question you said that the sources
directory is in the home directory of the first user. My guess is that the second user can't access the first user's home directory.
You might consider putting the sources
directory somewhere outside of the user's home directory.
Thank you. :) i had to use /mnt to create the sources for user lfs to be able to read.
â Akash Garg
Mar 27 at 1:45
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
This is a follow-up to @Kusalananda 's question in the comment associated with your question above.
Suppose that you have two users, user1
and user2
. Suppose that user1
has a home directory /home/user1
. Now suppose that in the home directory of user1
you create a directory owned by user2
, say /home/user1/sources
, can user2
access that directory?
In order for user2
to be able to access /home/user1/sources
, then user2
needs to have x
(traverse) permission on each directory from root, up to and including the sources
directory:
$ ls -ld /
dr-xr-xr-x 31 root root 4096 Feb 28 11:37 /
^ Check (this will almost always be OK)
$ ls -ld /home
drwxr-xr-x 4 root root 4096 Feb 28 11:38 /home
^ Check (this will almost always be OK)
$ ls -ld /home/user1
drwx------ 9 user1 group1 4096 Mar 21 00:36 /home/user1
^ ^ In this case, no, user2 cannot traverse here
$ ls -ld /home/user1/sources
drwxr-xr-x 9 user2 group2 4096 Mar 21 00:36 /home/user1/sources
^ Check
In this example, because user2
cannot traverse into /home/user1
, user2
cannot access /home/user1/sources
(even though user2
owns that directory).
In your question you said that the sources
directory is in the home directory of the first user. My guess is that the second user can't access the first user's home directory.
You might consider putting the sources
directory somewhere outside of the user's home directory.
This is a follow-up to @Kusalananda 's question in the comment associated with your question above.
Suppose that you have two users, user1
and user2
. Suppose that user1
has a home directory /home/user1
. Now suppose that in the home directory of user1
you create a directory owned by user2
, say /home/user1/sources
, can user2
access that directory?
In order for user2
to be able to access /home/user1/sources
, then user2
needs to have x
(traverse) permission on each directory from root, up to and including the sources
directory:
$ ls -ld /
dr-xr-xr-x 31 root root 4096 Feb 28 11:37 /
^ Check (this will almost always be OK)
$ ls -ld /home
drwxr-xr-x 4 root root 4096 Feb 28 11:38 /home
^ Check (this will almost always be OK)
$ ls -ld /home/user1
drwx------ 9 user1 group1 4096 Mar 21 00:36 /home/user1
^ ^ In this case, no, user2 cannot traverse here
$ ls -ld /home/user1/sources
drwxr-xr-x 9 user2 group2 4096 Mar 21 00:36 /home/user1/sources
^ Check
In this example, because user2
cannot traverse into /home/user1
, user2
cannot access /home/user1/sources
(even though user2
owns that directory).
In your question you said that the sources
directory is in the home directory of the first user. My guess is that the second user can't access the first user's home directory.
You might consider putting the sources
directory somewhere outside of the user's home directory.
answered Mar 23 at 15:31
Andy Dalton
4,7561520
4,7561520
Thank you. :) i had to use /mnt to create the sources for user lfs to be able to read.
â Akash Garg
Mar 27 at 1:45
add a comment |Â
Thank you. :) i had to use /mnt to create the sources for user lfs to be able to read.
â Akash Garg
Mar 27 at 1:45
Thank you. :) i had to use /mnt to create the sources for user lfs to be able to read.
â Akash Garg
Mar 27 at 1:45
Thank you. :) i had to use /mnt to create the sources for user lfs to be able to read.
â Akash Garg
Mar 27 at 1:45
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%2f433072%2fpermission-denied-for-reading-directory-owned-by-the-same-user%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
2
Does the parent directories of the "source" directory have execute permissions for the other user?
â Kusalananda
Mar 23 at 14:13
Concur with @Kusalananda - check the entire tree leading up to that directory. Chances are that's why you're getting locked out.
â Shadur
Mar 25 at 19:43