sshfs permission problem

2018-08-03 Thread Rudolf Sykora
Hello!

I run

doas sshfs syk...@pc109.fzu.cz: /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  wheel512 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



Re: sshfs permission problem

2018-08-03 Thread Maurice McCarthy
On 03/08/2018, Rudolf Sykora  wrote:
> doas sshfs syk...@pc109.fzu.cz: /home/ruda/mnt/fzu -o uid=1000 -o gid=1000

Leave out the 'doas' ?



Re: sshfs permission problem

2018-08-03 Thread Rudolf Sykora
On 3 August 2018 at 15:30, Maurice McCarthy  wrote:
> On 03/08/2018, Rudolf Sykora  wrote:
>> doas sshfs syk...@pc109.fzu.cz: /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



Re: sshfs permission problem

2018-08-03 Thread Alexander Hall



On August 3, 2018 3:44:07 PM GMT+02:00, Rudolf Sykora  
wrote:
>On 3 August 2018 at 15:30, Maurice McCarthy 
>wrote:
>> On 03/08/2018, Rudolf Sykora  wrote:
>>> doas sshfs syk...@pc109.fzu.cz: /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



Re: sshfs permission problem

2018-08-03 Thread Rupert Gallagher
Use umask  temporarily.

Sent from ProtonMail Mobile

On Fri, Aug 3, 2018 at 13:44, Rudolf Sykora  wrote:

> Hello!
>
> I run
>
> doas sshfs syk...@pc109.fzu.cz: /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


Re: sshfs permission problem

2018-08-10 Thread Hiltjo Posthuma
On Fri, Aug 03, 2018 at 01:44:39PM +0200, Rudolf Sykora wrote:
> Hello!
> 
> I run
> 
> doas sshfs syk...@pc109.fzu.cz: /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  wheel512 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  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



Re: sshfs permission problem

2018-08-10 Thread 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 syk...@pc109.fzu.cz: /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  wheel512 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  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 
Date:   Tue Jun 19 13:01:34 2018 +

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



Re: sshfs permission problem

2018-08-10 Thread 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  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 syk...@pc109.fzu.cz: /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  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 
> Date: Tue Jun 19 13:01:34 2018 +
>
> 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