Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 19/20 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 8th March 2009, 01:42 AM
openSauce Offline
Registered User
 
Join Date: Oct 2007
Posts: 50
Permission denied error when trying to mount image contained in sshfs mount

Hi

I have a filesystem mounted via sshfs, containing a file which itself contains a filesystem, but I get a 'permission denied' error when I try to mount it locally.

Code:
$ sudo mount -o loop sshfs-path/myfile.img /mnt/temp
sshfs-path/myfile.img: Permission denied
$
I get the same error trying to mount a different file from a different sshfs mount. This is all on my machine running Fedora 8 - my other machine running F9 but otherwise set up very similarly (ssh access to the same hosts etc) can mount the images when they are accessed via sshfs.

There don't appear to be any messages in /var/log/{secure,messages,audit/audit.log} relating to the error. Any ideas?

cheers

OS
Reply With Quote
  #2  
Old 8th March 2009, 01:02 PM
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
I experimented and found it will work if you run the sshfs command as root, eg

Code:
su -
mkdir sshfs_dir
mkdir /mnt/iso
sshfs user@a.b.c.d:/ sshfs_dir
mount -o loop sshfs_dir/home/user/disk.iso  /mnt/iso/
umount /mnt/iso
fusermount -u sshfs_dir
Reply With Quote
  #3  
Old 8th March 2009, 02:01 PM
openSauce Offline
Registered User
 
Join Date: Oct 2007
Posts: 50
Thanks, that works. However now my normal user can't access the sshfs mount, even though I've used the uid/gid options:

Code:
root@dion:~# sshfs rem93@a.b.com:scratch /mnt/croal_scratch/ -o uid=1000,gid=1000

# Normal user is owner of the mountpoint with rwx permissions,
# but running ls as the normal user gives permission denied error

root@dion:~# ls -l /mnt/
total 48
drwx------ 1 openSauce openSauce  4096 2009-02-25 23:18 croal_scratch
drwxr-xr-x 1 openSauce openSauce 12288 2009-03-04 17:52 data
drwxrwxr-x 2 openSauce openSauce  4096 2008-08-15 09:03 rem93
drwxr-xr-x 2 openSauce root  4096 2008-10-06 12:07 tc
drwxr-xr-x 2 root root  4096 2008-10-06 14:44 temp
drwxr-xr-x 2 openSauce openSauce  4096 2008-08-04 11:42 win
root@dion:~# su openSauce -c 'ls -l /mnt'
ls: cannot access /mnt/croal_scratch: Permission denied
total 44
d????????? ? ?    ?        ?                ? croal_scratch
drwxr-xr-x 1 openSauce openSauce 12288 2009-03-04 17:52 data
drwxrwxr-x 2 openSauce openSauce  4096 2008-08-15 09:03 rem93
drwxr-xr-x 2 openSauce root  4096 2008-10-06 12:07 tc
drwxr-xr-x 2 root root  4096 2008-10-06 14:44 temp
drwxr-xr-x 2 openSauce openSauce  4096 2008-08-04 11:42 win
root@dion:~#

Any ideas? It seems like it could be a bug, or perhaps it's due to my university's fairly restrictive sshd setup. Maybe I could fix it by giving the remote dir 777 permissions, but I don't want to do that.
Reply With Quote
  #4  
Old 8th March 2009, 02:17 PM
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
try

Code:
sshfs rem93@a.b.com:scratch /mnt/croal_scratch/  -o allow_other
Reply With Quote
  #5  
Old 8th March 2009, 02:36 PM
openSauce Offline
Registered User
 
Join Date: Oct 2007
Posts: 50
Perfect! Thanks.

EDIT: with that option, I don't even need to run sshfs as root any more - I can mount images even when the sshfs is mounted by the normal user. Seems a bit weird but I'm not complaining.

Last edited by openSauce; 8th March 2009 at 02:48 PM.
Reply With Quote
  #6  
Old 8th March 2009, 03:14 PM
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
Quote:
Originally Posted by openSauce View Post
Perfect! Thanks.

EDIT: with that option, I don't even need to run sshfs as root any more - I can mount images even when the sshfs is mounted by the normal user. Seems a bit weird but I'm not complaining.

So it does, thanks

In F10 you have to create /etc/fuse.conf first and add a single line 'user_allow_other', otherwise it only works as root.
Reply With Quote
Reply

Tags
contained, denied, error, image, mount, permission, sshfs

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba cifs error (mount error 13 = permission denied) jlrq74 Servers & Networking 10 23rd March 2009 06:01 PM
Samba 2.2.x serving Samba client 3.0.26 cifs (mount error 13 = Permission denied) nnn Servers & Networking 10 5th April 2008 09:40 AM
mount error permission denied cpri Servers & Networking 0 23rd January 2007 10:37 AM
mount error 13 = Permission denied pespinoza Servers & Networking 1 8th August 2005 06:27 PM


Current GMT-time: 20:28 (Wednesday, 20-08-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat