Shared sub-directory between multiple users [duplicate]












0















This question already has an answer here:




  • Execute vs Read bit. How do directory permissions in Linux work?

    7 answers




I have two users with home directories:



/home/user1/
/home/user2/


I would like to share a folder between the two users:



/home/user1/some/path/to/folder


but would only like user2 to have access to /home/user1/some/path/to/folder and not any of the parent directories. I tried to chmod 777 /home/user1/some/path/to/folder, but that didn't work.










share|improve this question















marked as duplicate by DarkHeart, Stephen Harris, Shadur, Mr Shunz, Michael Homer Dec 21 '18 at 3:32


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • You may try to use sshfs to create a "virtual" directory accessible by both users.
    – porton
    Dec 19 '18 at 22:28










  • wiki.archlinux.org/index.php/File_permissions_and_attributes
    – DarkHeart
    Dec 19 '18 at 22:33
















0















This question already has an answer here:




  • Execute vs Read bit. How do directory permissions in Linux work?

    7 answers




I have two users with home directories:



/home/user1/
/home/user2/


I would like to share a folder between the two users:



/home/user1/some/path/to/folder


but would only like user2 to have access to /home/user1/some/path/to/folder and not any of the parent directories. I tried to chmod 777 /home/user1/some/path/to/folder, but that didn't work.










share|improve this question















marked as duplicate by DarkHeart, Stephen Harris, Shadur, Mr Shunz, Michael Homer Dec 21 '18 at 3:32


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • You may try to use sshfs to create a "virtual" directory accessible by both users.
    – porton
    Dec 19 '18 at 22:28










  • wiki.archlinux.org/index.php/File_permissions_and_attributes
    – DarkHeart
    Dec 19 '18 at 22:33














0












0








0








This question already has an answer here:




  • Execute vs Read bit. How do directory permissions in Linux work?

    7 answers




I have two users with home directories:



/home/user1/
/home/user2/


I would like to share a folder between the two users:



/home/user1/some/path/to/folder


but would only like user2 to have access to /home/user1/some/path/to/folder and not any of the parent directories. I tried to chmod 777 /home/user1/some/path/to/folder, but that didn't work.










share|improve this question
















This question already has an answer here:




  • Execute vs Read bit. How do directory permissions in Linux work?

    7 answers




I have two users with home directories:



/home/user1/
/home/user2/


I would like to share a folder between the two users:



/home/user1/some/path/to/folder


but would only like user2 to have access to /home/user1/some/path/to/folder and not any of the parent directories. I tried to chmod 777 /home/user1/some/path/to/folder, but that didn't work.





This question already has an answer here:




  • Execute vs Read bit. How do directory permissions in Linux work?

    7 answers








permissions users






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 19 '18 at 22:28









DarkHeart

3,43422140




3,43422140










asked Dec 19 '18 at 22:20









user1763510

104




104




marked as duplicate by DarkHeart, Stephen Harris, Shadur, Mr Shunz, Michael Homer Dec 21 '18 at 3:32


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by DarkHeart, Stephen Harris, Shadur, Mr Shunz, Michael Homer Dec 21 '18 at 3:32


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • You may try to use sshfs to create a "virtual" directory accessible by both users.
    – porton
    Dec 19 '18 at 22:28










  • wiki.archlinux.org/index.php/File_permissions_and_attributes
    – DarkHeart
    Dec 19 '18 at 22:33


















  • You may try to use sshfs to create a "virtual" directory accessible by both users.
    – porton
    Dec 19 '18 at 22:28










  • wiki.archlinux.org/index.php/File_permissions_and_attributes
    – DarkHeart
    Dec 19 '18 at 22:33
















You may try to use sshfs to create a "virtual" directory accessible by both users.
– porton
Dec 19 '18 at 22:28




You may try to use sshfs to create a "virtual" directory accessible by both users.
– porton
Dec 19 '18 at 22:28












wiki.archlinux.org/index.php/File_permissions_and_attributes
– DarkHeart
Dec 19 '18 at 22:33




wiki.archlinux.org/index.php/File_permissions_and_attributes
– DarkHeart
Dec 19 '18 at 22:33










1 Answer
1






active

oldest

votes


















0














The /home directory has the execute permission set for everyone so that users can move into their homes inside but each user's home only has permissions for the user (unless configured otherwise for some reason).



The only way to get exactly what you want is by creating a group containing user2 and giving it execute permissions for home of user1 and the directories above the one that you want to share to make them traversable by user2 and then set the full permissions on the full directory. I would not recommend doing this as user2 would be able to ls specific files and subdirectories inside of the home of user1 which is a bad idea. You don't want to give another user permissions to someone else's home.



A better way to accomplish this would be to either make a directory in / and create a group containing the users and give them permissions to it or to create an nfs export with permissions for the two users only and mount it on the machine. Once again, do not give another user access to someone else's home.






share|improve this answer




























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The /home directory has the execute permission set for everyone so that users can move into their homes inside but each user's home only has permissions for the user (unless configured otherwise for some reason).



    The only way to get exactly what you want is by creating a group containing user2 and giving it execute permissions for home of user1 and the directories above the one that you want to share to make them traversable by user2 and then set the full permissions on the full directory. I would not recommend doing this as user2 would be able to ls specific files and subdirectories inside of the home of user1 which is a bad idea. You don't want to give another user permissions to someone else's home.



    A better way to accomplish this would be to either make a directory in / and create a group containing the users and give them permissions to it or to create an nfs export with permissions for the two users only and mount it on the machine. Once again, do not give another user access to someone else's home.






    share|improve this answer


























      0














      The /home directory has the execute permission set for everyone so that users can move into their homes inside but each user's home only has permissions for the user (unless configured otherwise for some reason).



      The only way to get exactly what you want is by creating a group containing user2 and giving it execute permissions for home of user1 and the directories above the one that you want to share to make them traversable by user2 and then set the full permissions on the full directory. I would not recommend doing this as user2 would be able to ls specific files and subdirectories inside of the home of user1 which is a bad idea. You don't want to give another user permissions to someone else's home.



      A better way to accomplish this would be to either make a directory in / and create a group containing the users and give them permissions to it or to create an nfs export with permissions for the two users only and mount it on the machine. Once again, do not give another user access to someone else's home.






      share|improve this answer
























        0












        0








        0






        The /home directory has the execute permission set for everyone so that users can move into their homes inside but each user's home only has permissions for the user (unless configured otherwise for some reason).



        The only way to get exactly what you want is by creating a group containing user2 and giving it execute permissions for home of user1 and the directories above the one that you want to share to make them traversable by user2 and then set the full permissions on the full directory. I would not recommend doing this as user2 would be able to ls specific files and subdirectories inside of the home of user1 which is a bad idea. You don't want to give another user permissions to someone else's home.



        A better way to accomplish this would be to either make a directory in / and create a group containing the users and give them permissions to it or to create an nfs export with permissions for the two users only and mount it on the machine. Once again, do not give another user access to someone else's home.






        share|improve this answer












        The /home directory has the execute permission set for everyone so that users can move into their homes inside but each user's home only has permissions for the user (unless configured otherwise for some reason).



        The only way to get exactly what you want is by creating a group containing user2 and giving it execute permissions for home of user1 and the directories above the one that you want to share to make them traversable by user2 and then set the full permissions on the full directory. I would not recommend doing this as user2 would be able to ls specific files and subdirectories inside of the home of user1 which is a bad idea. You don't want to give another user permissions to someone else's home.



        A better way to accomplish this would be to either make a directory in / and create a group containing the users and give them permissions to it or to create an nfs export with permissions for the two users only and mount it on the machine. Once again, do not give another user access to someone else's home.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 19 '18 at 22:58









        Nasir Riley

        2,306239




        2,306239















            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre