[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sshfs and permissions



On Thu, Mar 8, 2012 at 1:28 PM, Camaleón <noelamac@gmail.com> wrote:
> On Wed, 07 Mar 2012 18:27:29 +0100, Pierre Penninckx wrote:
>
> (...)
>
>> So like I said I didn't manage to make permission 100% work through
>> sshfs, though it works on the server or through DokanFS. The ACL on the
>> /srv/movies folder is: # file: movies
>> # owner: root
>> # group: videos
>> # flags: -s-
>> user::rwx
>> group::rwx
>> other::r-x
>> default:user::rwx
>> default:group::rwx
>> default:other::r-x
>> (and the default user umask is 0022)
>>
>> When creating a file in this directory while connect through the server
>> (or with DokanFS), the file has these permissions:
>> rw-rw-r-- fine.
>> But when creating it through sshfs it have:
>> rw-r--r-- bad.
>> And rwxr-xr-x for folders.
>>
>> First, thanks for reading my long post. Second, do you have any
>> suggestions ? I don't really know what to test.
>
> I Googled a bit and found some information about this problematic. For
> instance, this blog article explains the issue quite well:
>
> SSHFS: fix for wrong file permissions on server
> http://andre.frimberger.de/index.php/linux/sshfs-fix-for-wrong-file-permissions-on-server/
>
> I don't know if that matches for your current situation nor if it helps
> you in any way but maybe can trigger a light in your head :-)

The first paragraph of that URL mentions sftp, "SSHFS normally
propagates the umask of the client to the server. This works great
when the sftp server doesn’t care about the umask while creating files
or directories. But the problem is, that the openssh sftp server
indeed cares about the server side umask", so I checked the sshfs man
page and it says "On the remote computer the SFTP subsystem of SSH is
used". You should therefore be able to set the umask for sftp via the
usual wrapper script and get the umask that you want.


Reply to: