Let's say I have access to directory on some filesystem - /media/vc1/ mounted and owned by user1. I want to give access to user2 (uid == 1001) to some directory in /media/vc1/ (without making copy of files). Ideally, I would like to create directory /home/user2/mnt which would contain contents of /media/vc1/ . I have tried to run following command as root:
mount --bind -o uid=1001 /media/vc1/ /home/user2/mnt/
It does not work, here is stat of mnt directory:
Access: (0700/drwx------) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
and access is denied to user2.
To be clear, I'm not able to remount /media/vc1 as different user.
According to this answer, you can't use uid and gid options with --bind. I'm not sure how correct command would look like (I don't want to make this permanent using fstab.).