Assuming I have a folder /mnt/mountpoint
that I use as a mountpoint for some sshfs
-mounted directory:
sshfs user@host /mnt/mountpoint
Now, I want to prevent applications to write to /mnt/mountpoint
while it is unmounted. Questions I found here and here have answers that imply using
sudo chattr +i /mnt/mountpoint
which works fine to prevent any write-access. Unfortunately, it also prevents me from mounting with sshfs
as a normal user.
What would be the best solution for this? I would prefer a single sshfs-command or something that at least doesn't require root privileges. Should I forego the chattr
approach and try something entirely different?