On 2020-09-16 14:38, David Wright wrote:
On Wed 16 Sep 2020 at 12:56:36 (-0700), David Christensen wrote:
On 2020-09-16 01:59, Andrei POPESCU wrote:

If I change the mode of the mount point to 0000:

Is there some advantage other than making a long listing visually
distinctive when the mount point is not in use?

Yes. As explained earlier in the thread, it prevents user OP from
accidentally scribbling in the unused mountpoint.

The default permissions 0755 already do that:

2020-09-17 13:21:22 dpchrist@tinkywinky ~
$ touch /f1/foo
touch: cannot touch '/f1/foo': Permission denied


Another side-effect is that you can't enter the mountpoint directory
in, say, mc, which avoids your thinking that the intended filesystem
(were it actually mounted) is itself empty.

2020-09-17 13:23:59 dpchrist@tinkywinky ~
$ ssh root@localhost
Linux tinkywinky 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Last login: Wed Sep 16 12:31:13 2020 from ::1

2020-09-17 13:24:03 root@tinkywinky ~
# chmod 0000 /f1

2020-09-17 13:24:08 root@tinkywinky ~
# q
logout
Connection to localhost closed.

2020-09-17 13:24:17 dpchrist@tinkywinky ~
$ cd /f1
bash: cd: /f1: Permission denied


Confirmed -- changing mode to 0000 prevents non-root users from changing into that directory.


But—I see that your own intended filesystem for f1 is fuse.sshfs.
Can you, as a user, mount this filesystem now? I'd be interested
to know how, if you can, because I'm just now thinking about enhancing
my udev rule to chown a mount (in favour of me) if the fstab entry
is a fuse one (eg ntfs and exfat).

I have always mounted /f1 as root.  Trying it as non-root:

2020-09-17 13:24:24 dpchrist@tinkywinky ~
$ mount /f1
mount: only root can mount f1:/ on /f1


David

Reply via email to