Prevent writing to unmounted sshfs mount point

Mount point default permissions

Create the mountpoint with

mkdir --mode=0500 -p /mnt/mountpoint

Only the creating user will be able to write to it. You could pre-populate this from rc.local. When you mount whatever filesystem lives on top of that mount point, it will pick up the permissions of that overlay that you had set when it was mounted.

On a side note, I would avoid chattr +i as that will confuse folks and cause troubleshooting fun down the road if not everyone is aware you did that.

Tags:

Linux

Mount

Sshfs