[X2go-dev] SSHFS and Permissions
John A. Sullivan III
jsullivan at opensourcedevel.com
Mon Jan 31 13:40:18 CET 2011
On Mon, 2011-01-31 at 12:09 +0000, --[ UxBoD ]-- wrote:
> Hello all,
>
> I have been working on making removable media available to Windows via a Samba share and hit a very strange problem. When you initially save a file to the share it would complain about having insufficient permissions, though if you were to save it again straight away it would work.
>
> The problem has been tracked down to how the SSHFS is mounted from within x2gomountdirs. The original command was:
>
> sshfs -o ServerAliveInterval=300,Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port 2>>~/mounts.log
>
> for which I have changed it too:
>
> sshfs -o uid=$uid -o gid=$gid -o ServerAliveInterval=300,Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port 2>>~/mounts.log
>
> with those two new variables being set via:
>
> my (undef,undef,$uid,$gid) = getpwuid($<);
>
> and the resulting mount have the ownership of the users primary id and group.
>
> Is there any reason why this approach was not used ? or it worked quite happily as the mount is 777 anyway ?
If there is not a reason why this approach was not originally used, I
would suggest we add it as a patch to X2Go. We are still testing but we
think this may also solve several other problems we have encountered
with Windows users sharing their local media. Thanks, Phil - John
More information about the x2go-dev
mailing list