sshfs permission problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

sshfs permission problem

Rudolf Sykora
Hello!

I run

doas sshfs [hidden email]: /home/ruda/mnt/fzu -o uid=1000 -o gid=1000

But then the mount point is owned (after the mounting) by root:

drwx------  1 root  wheel    512 Aug  3 13:22 fzu

Hence I cannot enter the directory as the usual (and wanted) user 'ruda'.

1) doas chmod 777 fzu             does not help (does nothing)
2) doas chown ruda:ruda fzu       gives permission denied

What can I do?

Thanks
Ruda

Reply | Threaded
Open this post in threaded view
|

Re: sshfs permission problem

Maurice McCarthy-3
On 03/08/2018, Rudolf Sykora <[hidden email]> wrote:
> doas sshfs [hidden email]: /home/ruda/mnt/fzu -o uid=1000 -o gid=1000

Leave out the 'doas' ?

Reply | Threaded
Open this post in threaded view
|

Re: sshfs permission problem

Rudolf Sykora
On 3 August 2018 at 15:30, Maurice McCarthy <[hidden email]> wrote:
> On 03/08/2018, Rudolf Sykora <[hidden email]> wrote:
>> doas sshfs [hidden email]: /home/ruda/mnt/fzu -o uid=1000 -o gid=1000
>
> Leave out the 'doas' ?

Afaik, no, you can't.
Any mounting on OpenBSD seems to need root privileges.

Ruda

Reply | Threaded
Open this post in threaded view
|

Re: sshfs permission problem

Alexander Hall


On August 3, 2018 3:44:07 PM GMT+02:00, Rudolf Sykora <[hidden email]> wrote:

>On 3 August 2018 at 15:30, Maurice McCarthy <[hidden email]>
>wrote:
>> On 03/08/2018, Rudolf Sykora <[hidden email]> wrote:
>>> doas sshfs [hidden email]: /home/ruda/mnt/fzu -o uid=1000 -o
>gid=1000
>>
>> Leave out the 'doas' ?
>
>Afaik, no, you can't.
>Any mounting on OpenBSD seems to need root privileges.

Yes it does. I seldom use sshfs myself, but last time I tried, some weeks ago, I experienced the same situating. I solved my problem another way and assumed I had something badly set up.

Please do send a proper bug report. Not sure if the issue is in base or the port though.

/Alexander

Reply | Threaded
Open this post in threaded view
|

Re: sshfs permission problem

Rupert Gallagher
In reply to this post by Rudolf Sykora
Use umask 0000 temporarily.

Sent from ProtonMail Mobile

On Fri, Aug 3, 2018 at 13:44, Rudolf Sykora <[hidden email]> wrote:

> Hello!
>
> I run
>
> doas sshfs [hidden email]: /home/ruda/mnt/fzu -o uid=1000 -o gid=1000
>
> But then the mount point is owned (after the mounting) by root:
>
> drwx------ 1 root wheel 512 Aug 3 13:22 fzu
>
> Hence I cannot enter the directory as the usual (and wanted) user 'ruda'.
>
> 1) doas chmod 777 fzu does not help (does nothing)
> 2) doas chown ruda:ruda fzu gives permission denied
>
> What can I do?
>
> Thanks
> Ruda
Reply | Threaded
Open this post in threaded view
|

Re: sshfs permission problem

Hiltjo Posthuma
In reply to this post by Rudolf Sykora
On Fri, Aug 03, 2018 at 01:44:39PM +0200, Rudolf Sykora wrote:

> Hello!
>
> I run
>
> doas sshfs [hidden email]: /home/ruda/mnt/fzu -o uid=1000 -o gid=1000
>
> But then the mount point is owned (after the mounting) by root:
>
> drwx------  1 root  wheel    512 Aug  3 13:22 fzu
>
> Hence I cannot enter the directory as the usual (and wanted) user 'ruda'.
>
> 1) doas chmod 777 fzu             does not help (does nothing)
> 2) doas chown ruda:ruda fzu       gives permission denied
>
> What can I do?
>
> Thanks
> Ruda
>

Hi,

I have the same issue here.

chmod 777 changes the permisions, but seems to reset them automatically after a
second or so.

The umask 0000 suggestion doesn't work either unfortunately.

On 6.3 this problem doesn't occur, but on -current it does. I'll try to bisect
it later.

--
Kind regards,
Hiltjo

Reply | Threaded
Open this post in threaded view
|

Re: sshfs permission problem

Hiltjo Posthuma
On Fri, Aug 10, 2018 at 10:38:52AM +0200, Hiltjo Posthuma wrote:

> On Fri, Aug 03, 2018 at 01:44:39PM +0200, Rudolf Sykora wrote:
> > Hello!
> >
> > I run
> >
> > doas sshfs [hidden email]: /home/ruda/mnt/fzu -o uid=1000 -o gid=1000
> >
> > But then the mount point is owned (after the mounting) by root:
> >
> > drwx------  1 root  wheel    512 Aug  3 13:22 fzu
> >
> > Hence I cannot enter the directory as the usual (and wanted) user 'ruda'.
> >
> > 1) doas chmod 777 fzu             does not help (does nothing)
> > 2) doas chown ruda:ruda fzu       gives permission denied
> >
> > What can I do?
> >
> > Thanks
> > Ruda
> >
>
> Hi,
>
> I have the same issue here.
>
> chmod 777 changes the permisions, but seems to reset them automatically after a
> second or so.
>
> The umask 0000 suggestion doesn't work either unfortunately.
>
> On 6.3 this problem doesn't occur, but on -current it does. I'll try to bisect
> it later.
>
> --
> Kind regards,
> Hiltjo
>

I figured it out and it doesn't seem like a bug, just a changed behaviour. The
following commit changed it:

CVS revision 1.47:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libfuse/fuse.c?rev=1.47&content-type=text/x-cvsweb-markup

or git commit:

commit 0f4d2db5a50672bad418a08041219503c0deeced
Author: helg <[hidden email]>
Date:   Tue Jun 19 13:01:34 2018 +0000

    Changes the default mount behaviour so only the user that mounts the
    file system can access it unless the allow_other mount options is
    specified. The allow_other mount option makes the file system
    available to other users just like any other mounted file system.

    ok mpi@


So the solution is to use the option: -o allow_other, for example:
        sshfs -o allow_other user@host:dir /mnt/mount

I hope this helps someone.

--
Kind regards,
Hiltjo

Reply | Threaded
Open this post in threaded view
|

Re: sshfs permission problem

Rupert Gallagher
When you run anything that writes something, that something will have your umask. If you run something as root, set root's umask before running it, not afterwards. Write a script that sets the umask and runs sshfs, then run the script using doas.

On Fri, Aug 10, 2018 at 15:13, Hiltjo Posthuma <[hidden email]> wrote:

> On Fri, Aug 10, 2018 at 10:38:52AM +0200, Hiltjo Posthuma wrote:
>> On Fri, Aug 03, 2018 at 01:44:39PM +0200, Rudolf Sykora wrote:
>> > Hello!
>> >
>> > I run
>> >
>> > doas sshfs [hidden email]: /home/ruda/mnt/fzu -o uid=1000 -o gid=1000
>> >
>> > But then the mount point is owned (after the mounting) by root:
>> >
>> > drwx------ 1 root wheel 512 Aug 3 13:22 fzu
>> >
>> > Hence I cannot enter the directory as the usual (and wanted) user 'ruda'.
>> >
>> > 1) doas chmod 777 fzu does not help (does nothing)
>> > 2) doas chown ruda:ruda fzu gives permission denied
>> >
>> > What can I do?
>> >
>> > Thanks
>> > Ruda
>> >
>>
>> Hi,
>>
>> I have the same issue here.
>>
>> chmod 777 changes the permisions, but seems to reset them automatically after a
>> second or so.
>>
>> The umask 0000 suggestion doesn't work either unfortunately.
>>
>> On 6.3 this problem doesn't occur, but on -current it does. I'll try to bisect
>> it later.
>>
>> --
>> Kind regards,
>> Hiltjo
>>
>
> I figured it out and it doesn't seem like a bug, just a changed behaviour. The
> following commit changed it:
>
> CVS revision 1.47:
> http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libfuse/fuse.c?rev=1.47&content-type=text/x-cvsweb-markup
>
> or git commit:
>
> commit 0f4d2db5a50672bad418a08041219503c0deeced
> Author: helg <[hidden email]>
> Date: Tue Jun 19 13:01:34 2018 +0000
>
> Changes the default mount behaviour so only the user that mounts the
> file system can access it unless the allow_other mount options is
> specified. The allow_other mount option makes the file system
> available to other users just like any other mounted file system.
>
> ok mpi@
>
> So the solution is to use the option: -o allow_other, for example:
> sshfs -o allow_other user@host:dir /mnt/mount
>
> I hope this helps someone.
>
> --
> Kind regards,
> Hiltjo