• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Can only run sshfs as root

Harry Stone

New Member

Thanks: 1
Messages: 17

Is there anything special I need to do to run sshfs as a regular user? I saw another thread here from a while back that says I need vfs.usermount set to 1, which I do, but still no luck. It works fine when run as root but otherwise I get "operation not permitted."

I can make this work by adding setuid permissions to /sbin/mount_fusefs. But is that the only way?

Last edited by a moderator:



Thanks: 737
Messages: 1,610

I have never used sshfs on FreeBSD but on OpenBSD user mount option was removed about a year ago. I don't recall the reason but you can probably find out on tech@openbsd. You have to be root to mount the file system.


Have you read man pages for sshfs for your version of FreeBSD. I would not rely on any Internet archive and I would be very worried about getting outdated information even from the official FreeBSD handbook. That thing is really hit and miss and it is not properly updated.


Staff member

Thanks: 5,998
Messages: 26,762

I saw another thread here from a while back that says I need vfs.usermount set to 1, which I do, but still no luck.
This setting allows a user to mount filesystems. But there's another requirement, the user must also be the owner of the mountpoint.

Nicola Mingotti

Active Member

Thanks: 89
Messages: 185

To me it works, I spent a lot of time to have it working well, it is very important IMO.
The following procedure is valid for FreeBSD-11.1.

Here is what is written into my notes: ( my user in FreeBSD is "p")
root@fbs> pkg install fusefs-sshfs-3.3.0
root@fbs> sysctl vfs.usermount=1
root@fbs> pw groupmod operator -m p
Then I mount a handfull of remote directories as user "p"
in FreeBSD, like in the next step. In this case I mount an OSX directory
/Users/Nicola/Downloads owned by "nicola" there, into the local dir /home/p/osx
owned by "p" in FreeBSD.
p@fbs> OPT='-o idmap=user -o ServerAliveInterval=15 -o reconnect'
p@fbs> sshfs $OPT nicola@ /home/p/osx
CAVEAT. Be carefull, the above is ok for testing, but use fusefs-sshfs from ports to have release >= 3.3.1, there is an ugly bug in the package version 3.3.0. I have opened a thread about this a short time ago;)

Nicola Mingotti

Active Member

Thanks: 89
Messages: 185

You mistook something or the man page is wrong.
It think the first option is far more probable.

Tha man page for sshfs states
It is recommended to run SSHFS as regular user (not as root).  For this
to work the mountpoint must be owned by the user.
1] (root) I made a user "test"
2] (root) I added user "test" to group "operator"
3] I logged in as user "test"
3.1] I checked to be in group "operator" groups
3.2] I checked to be into "test" home directory
4] I made a directory "mnt" in user "test" home
5] Then I did
test@localhost> sshfs  foo@bar.baz:/home/foo ~/mnt/
=> It works

I got the same error you are talking about in two cases:
1] I don't add user "test" to group "operator"
2] I don't monut sshfs to a directory owned by "test"

Hope you can make it, sshfs for me it is fundamental so I undestand your position.