LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-19-2011, 12:36 PM   #1
startoftext
LQ Newbie
 
Registered: Dec 2008
Posts: 12

Rep: Reputation: 0
Why cant users access files that they own on SSHFS mounted file system?


I am trying to mount a directory over ssh from a server. I mount with the below command while root.

Code:
sshfs -o allow_other admin@<hostip>:/data/home /home/ldapusers
It mounts fine and with the -o allow_others the other users on the system cd into the mounted dir structure and read files just fine. The part I cant understand is that even in the directories that are owned by regular users they are not able to write anything.

For example in the folder /home/ldapusers/user1 (I replaced the user name for privacy reasons). ls gives this output for that folder:
Code:
drwxr-xr-x. 1 user1 unix_admin 4.0K Aug 18 16:43 user1
When I am inside that folder and logged in as user1 I cannot write anything. For example:
Code:
-bash-4.1$ touch foo
touch: cannot touch `foo': Permission denied
Because user1 is an ldap user I verified that user1's uid number was the same as the owner of that folder, just in case there was a uid mismatch. Also I am running centos 6 on both client and server if that matters. I am at a loss for why this is happening. It appears to me that the user should be able to access a folder they own and have full perms on. Is this because sshfs is a userspace file system?
 
Old 08-19-2011, 02:28 PM   #2
startoftext
LQ Newbie
 
Registered: Dec 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Just replying to my own post because I think I figured it out. Correct me if I am wrong but I think this is the issue. So when I mount the ssh share the authentication I use on the ssh host is admin. On the ssh host the admin user is in the group unix_admin. So what happens is because the perms on those home dirs allows read and execute permission for any one in the group unix_admin, the users on the client (the machine that the share is mounted on) can read and execute but cannot write. When I authenticated as root against the ssh host it allowed write access but only because root can read and write to any directory on the host. So basically it means that although other users may be accessing the mount on the client, they are accessing them with the perms of the user that mounted that share. Basically to put it simply it does not work the same way that... for example an nfs mount would.

This was a surprise but it was confirmed by this page: http://sourceforge.net/apps/mediawik...title=SshfsFaq Where it says "Generally it's not possible to use an sshfs mount as a "real" filesystem shared between multiple users. Some of this functionality can be enabled with the -o allow_other and -o default_permissions options, but files will not be created with the correct ownership, etc... "
 
  


Reply

Tags
centos, permissions, sshfs



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Programs cannot create temp files on nfs-mounted NTFS file system rl92694 Linux - Networking 2 05-21-2013 05:08 PM
root file system more users with different access before mounting hieswarmcaquest Linux - General 1 05-13-2011 02:39 AM
ext3 file system is re mounted with readonly access. santhosh1986 Linux - General 5 10-04-2010 11:27 PM
software to access file system.. how to allow access for non root users? stdcinout Linux - Newbie 8 03-09-2010 12:55 PM
different users can all access file system and copy/paste? mhg Linux - Newbie 3 10-28-2008 09:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration