sshfs user Permission Denied

Hi!

I'm trying to sshfs on to a linux box. Have installed sshfs from ports. Super User manages this fine, but I can't get in to the mount point as normal user (denied):

Code:
$ ls -al /usr/local/bin/sshfs
-r-xr-xr-x  1 root  wheel  49584 Jul  8 20:59 /usr/local/bin/sshfs

The normal user is part of the wheel so I would have thought that it has same access level as root does.. but when I look at the file properties of the mount point when root uses sshfs on it:

Code:
Owner: 1000 - user #1000
Group: 1000

I try to add myself to that group but it doesn't exist. Please could someone tell me how to make sshfs usable to non super users please?
 
wblock said:
Make the normal user the owner of the mount point.

Thanks for your reply!

I did, normal created it. If it makes any difference, it was in my home directory: /home/usr/mnt
 
Does the user have read access to the remote filesystem?
Who does the mounting?
When does it fail?
How does it fail? - What is the error message.
What command are you using to mount the remote filesystem?

I just installed fusefs-sshfs to check, and I have no problems.

My local-user can mount the remote filesystem, as can root.

The stuff posted by wblock does not need to be applied. The only thing that I needed to change was # sysctl vfs.usermount =1
 
mix_room said:
The stuff posted by wblock does not need to be applied. The only thing that I needed to change was # sysctl vfs.usermount =1

That was what I posted. Or are you saying the mount point doesn't need to be owned by the user for sshfs?
 
andyzammy said:
I tried this, but I'm not sure that I'm applying the tutorial correctly to mounting for sshfs. Do I chgrp to wheel? And do I chmod to 666 or 640? After applying chgrp I couldn't ls the directory as the normal user (denied).

The permission changes are only needed if you're trying to mount a device in /dev that the user doesn't normally have permission to. That's not the case here.

Code:
% id -p
uid	wblock
groups	wheel operator
% sysctl vfs.usermount
vfs.usermount: 1
% mkdir sshmount
% sshfs wblock@othersystem:/tmp sshmount

Tested here.
 
mix_room said:
Does the user have read access to the remote filesystem?
Who does the mounting?
When does it fail?
How does it fail? - What is the error message.
What command are you using to mount the remote filesystem?

I just installed fusefs-sshfs to check, and I have no problems.

My local-user can mount the remote filesystem, as can root.

The stuff posted by wblock does not need to be applied. The only thing that I needed to change was # sysctl vfs.usermount =1

user tries to mount

fails after I give the password:

Code:
sshfs user@desktop:/home/user /home/usr/mnt
user@desktop.home's password:
fuse: failed to open fuse device: Permission denied

Code:
sysctl vfs.usermount
vfs.usermount: 0
I tried sshfs after the sysctl command you gave and it said:

Code:
Directory stack not that deep.
 
andyzammy said:
Code:
sshfs user@desktop:/home/user /home/usr/mnt
user@desktop.home's password:
fuse: failed to open fuse device: Permission denied

/dev/fuse0 has an owner of operator. Is the user a member of the operator group?

I tried sshfs after the sysctl command you gave and it said:

Code:
Directory stack not that deep.

No idea on that, but it's closer. "desktop" is a different computer than the one doing the sshfs, right?
 
wblock said:
/dev/fuse0 has an owner of operator. Is the user a member of the operator group?



No idea on that, but it's closer. "desktop" is a different computer than the one doing the sshfs, right?

Ah, okay, so I added user to operator group, now I'm getting a different message:

Code:
mount_fusefs: /dev/fuse0 on /usr/home/user/mnt: Operation not permitted
fuse: failed to mount file system: No such file or directory

Yes, desktop is my linux box, trying to sshfs in from my laptop. Is it the ext4 FS that it's complaining about now? Or does it have something to do with vfs.usermount?
 
Yes, vfs.usermount=1 is needed. That's why you got "operation not permitted". Put it in /etc/sysctl.conf.

The actual filesystem on the target doesn't matter at all. You're connecting through ssh, and letting the target system handle all the actual filesystem access.
 
wblock said:
That was what I posted. Or are you saying the mount point doesn't need to be owned by the user for sshfs?

Sorry for not being clear. I was refering to all the stuff about changing permissions on block devices and the rest of the information in your link.

andy: run # sysctl vfs.usermount = 1 and then try again. You NEED to set the variable. What you ran just queries the variable.
 
mix_room said:
Sorry for not being clear. I was refering to all the stuff about changing permissions on block devices and the rest of the information in your link.

andy: run # sysctl vfs.usermount = 1 and then try again. You NEED to set the variable. What you ran just queries the variable.

I did run the "=1" cmd and it did give "Directory stack not that deep." back to me. However, running it now gives:

Code:
vfs.usermount: 0
sysctl: unknown oid ''
 
After updating sysctl.conf, does anything need to be restarted? I am still getting "failed to open fuse device - no such file or dir".
 
Values in /etc/sysctl.conf are read and acted upon at boot. However, if you have also executed # sysctl vfs.usermount=1, you should be good to go, as this sets the variable immediately.
Your error message "no such file or dir" indicates a different problem. Have you looked carefully at the paths your are trying to mount (both to and from)? If either of those don't exist, you will end up with an error.
 
Back
Top