2

I need to mount a share using sshfs.

When I mount it using sshfs directly, i.e.

# sshfs [email protected]:/home/data/ -o allow_other /mnt/data/ 

or

# sshfs [email protected]:/home/data/ -o allow_other,default_permissions /mnt/data/ 

the share is mounted, but only in "read-only" mode. However when I add following line into /etc/fstab, and do mount /mnt/data, then the share is mounted read-write.

# [email protected]:/home/data/ /mnt/data fuse.sshfs noauto,_netdev,allow_other,default_permissions 0 0 

Both commands are issued unde root. Why does sshfs from the command line mount the filesystem read-only?

How can I mount it read-write using the sshfs command?

3
  • using the first option, is the share mounted read-only also for root or only members of the users group? Commented Nov 1, 2015 at 9:18
  • @Sebastian - it is mounted read-only for root as well. Commented Nov 1, 2015 at 9:27
  • What exactly do you meant by “mounted read-only”? Copy-paste the output of grep /mnt/data /proc/mounts and touch /mnt/data/foo while it's mounted read-only. Also copy-paste the messages from the system logs at the time of mounting and (if there are any) at the time of the write attempt. Commented Nov 1, 2015 at 23:24

2 Answers 2

0

I had a similar issue, and this post helped me discover what was wrong.

Mount with sshfs and write file permissions

In the post's accepted solution (https://unix.stackexchange.com/a/282941/453832), it mentions that you should not mix allow_other and default_permissions as you have in your post. This could be a good starting point to track down where the mount is failing.

I recommend running the same troubleshooting approach from the post to track down the issue.

In my case, it was the remote user's inability to write in the source directory that made my fuse mount fail to write.

-2

You should append undocumented variant ,ro to -o allow_other param

 # sshfs [email protected]:/home/data/ -o allow_other,ro /mnt/data/ 
1
  • The question asks how to mount it read-write. Your suggestion forces a read-only mount. Commented Nov 22, 2021 at 18:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.