Thanks for these details. I followed a few tutos, but there were many uncommented parameters. Write-only is exactly that, permissions 330 or 333, as for this application, if an intruder gained access to the Pi, he wouldn't be able to delete files, worse than writing bogus ones. Or perhaps less paranoid, a misconfiguration on the Pi wouldn't allow me to accidentally erase files. As I said, the server is a very fragile configuration I can't easily change, otherwise I would have made a chroot with a new user "pi" on it. By default, only
root has access through SSH, also the reason why I chose a long and hard password and non-default port. If I break the configuration, there's no easy way for me to recover as the server is miles away.
I thought the "pi" flag would allow user
pi to be the owner of the mounted folder. I did try a manual mount before without specifying user, and ended up with unknown permissions, making the folder inaccessible unless using
root. Probably what you point with
sshfs makes no attempt to translate between them
.
I want only user pi to have root access to the server, the reason why I assumed I had to
ssh-keygen and
ssh-copy-id from user
pi, but on the other hand, automated mount is done through
fstab being executed as
root. Would I need to put this mount call in
pi's
init.d, then, instead of system-wide
fstab? Wouldn't that cause issues if the applications used to write in the mounted folder run as a different user than
pi? Of course I can mount it manually with correct permissions, but this isn't what I want to do. It must be automated and self-recovering. If the writing application crashes if ever the mount is unavailable, then it may be simpler to have the script reboot the RPi.