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

Re: sshfs has fubared mount



On Tuesday 09 February 2021 02:29:02 David Christensen wrote:

> On 2021-02-08 21:01, Gene Heskett wrote:
> > Greetings all;
> >
> > I have sshfs setup so I can move files around between this box and 4
> > others, 3 of which are now running buster.  Works only for the user,
> > me.
>
> My Debian machines are Stretch, but I would expect that the basics of
> sshfs(1) have not changed on Buster (?).

So would I since the same install media was used to install the 3 wintel
boxes, the 4th is an rpi4b running raspbian buster. And it Just Works too.
>
> My username 'dpchrist', UID, groupname 'dpchrist', and GID are the
> same on all of my machines.

ditto
>
> I have previously installed my public SSH key from the local computer
> 'tinkywinky' to the remote computer 'po' with ssh-copy-id(1):

Don't recall doing this, plz describe>
>
> sshd_config(5) is the same on both computers:
>
> 2021-02-08 23:20:06 dpchrist@tinkywinky ~
> $ grep -v '#' /etc/ssh/sshd_config | grep .
> ChallengeResponseAuthentication no
> UsePAM yes
> X11Forwarding yes
> PrintMotd no
> AcceptEnv LANG LC_*
> Subsystem	sftp	/usr/lib/openssh/sftp-server
>
> 2021-02-08 23:19:53 dpchrist@po ~
> $ grep -v '#' /etc/ssh/sshd_config | grep .
> ChallengeResponseAuthentication no
> UsePAM yes
> X11Forwarding yes
> PrintMotd no
> AcceptEnv LANG LC_*
> Subsystem	sftp	/usr/lib/openssh/sftp-server
>
>
> If you modify sshd_config(5) on either machine, be sure to restart
> sshd(8).
>
>
> ssh_config(5) is the same on both computers:
>
> 2021-02-08 23:20:59 dpchrist@tinkywinky ~
> $ grep -v '#' /etc/ssh/ssh_config | grep .
> Host *
> ForwardAgent yes
>      SendEnv LANG LC_*
>      HashKnownHosts yes
>      GSSAPIAuthentication yes
>
> 2021-02-08 23:19:57 dpchrist@po ~
> $ grep -v '#' /etc/ssh/ssh_config | grep .
> Host *
> ForwardAgent yes
>      SendEnv LANG LC_*
>      HashKnownHosts yes
>      GSSAPIAuthentication yes
>
>
> I created an fstab(5) entry on the local machine for mounting the
> remote root directory with my unprivileged account.  Note the options:

I've never had any of this below in my fstab, haven't needed it for the
other 4 machines.

> 2021-02-08 22:37:51 dpchrist@tinkywinky ~
> $ grep 'po:/' /etc/fstab | perl -pe 's/\t+/ /g'
> po:/ /po fuse.sshfs ro,noauto,user 0 0
>
>
> I created a mount point and I set the owner and group to match my
> unprivileged account.  The directory is empty:
>
> 2021-02-08 22:39:38 dpchrist@tinkywinky ~
> $ ls -la /po
> total 8
> drwxr-xr-x  2 dpchrist dpchrist 4096 Jan 21 13:32 .
> drwxr-xr-x 27 root     root     4096 Jan 21 13:32 ..

Matches mine. Difference is that I put all those mountpoints in the /sshnet subdir
gene@coyote:~$ ls -la /sshnet/
total 36
drwxr-xr-x  9 gene gene 4096 Feb  9 07:37 .
drwxr-xr-x 28 root root 4096 Dec 12 03:44 ..
drwxr-xr-x  1 root root 4096 Feb  4 15:59 GO704
drwxr-xr-x  2 root root 4096 Feb  8 10:10 Hardinge1
drwxr-xr-x  1 root root 4096 Feb  3 14:16 lathe
drwxr-xr-x  2 root root 4096 Apr 25  2019 redpitaya
drwxr-xr-x  1 root root 4096 Feb  1 04:46 rpi4
drwxr-xr-x  1 root root 4096 Feb  4 15:43 sixty40
drwxr-xr-x  2 root root 4096 May  2  2019 vna

The 2 extra mountpoints are for a vector network analyser when it was 
setup for testing, I am a retired broadcast engineer whose been known
to tune an AM stations tower now and then. Doing that right usually involves a
dead chicken and other bits of black art. :) But using a vna instead 
of a 75 yo General Radio rf bridge, makes it 100x faster.  The vna 
draws a smith chart in seconds.

> I use mount(8) to mount the remote filesystem:
>
> 2021-02-08 22:42:15 dpchrist@tinkywinky ~
> $ mount /po

Where I'm using sshfs, not mount.

> 2021-02-08 22:42:32 dpchrist@tinkywinky ~
> $ mount | grep '/po'
> po:/ on /po type fuse.sshfs
> (ro,nosuid,nodev,noexec,relatime,user_id=redacted,group_id=redacted,us
>er=dpchrist)
>
> 2021-02-08 23:15:47 dpchrist@tinkywinky ~
> $ ls -ld /po/home/dpchrist
> drwxr-xr-x 1 dpchrist dpchrist 4096 Feb  8 15:02 /po/home/dpchrist
>
>
> RTFM sshfs(1) is wrong regarding unmounting:
>
> 2021-02-08 23:15:38 dpchrist@tinkywinky ~
> $ man sshfs | grep -B 4 umount
>     mounting
>         sshfs [user@]host:[dir] mountpoint [options]
>
>     unmounting
>         umount mountpoint
>
> 2021-02-08 22:50:21 dpchrist@tinkywinky ~
> $ umount /po
> umount: /po: Permission denied
>
>
> Old-school fusermount(1) works:
>
> 2021-02-08 22:51:57 dpchrist@tinkywinky ~
> $ fusermount -u /po
>
And mount by itself, lists this at the end of a long list
on ths machine:

fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gene@sixty40.coyote.den:/ on /sshnet/sixty40 type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
pi@rpi4:/ on /sshnet/rpi4 type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
gene@lathe:/ on /sshnet/lathe type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
gene@GO704:/ on /sshnet/GO704 type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

And thefusectl line only exists on one of the other machines,
so its not part of this problem. 3 are working fine w/o it.

Thanks David, but it looks like I need a fresh pot of coffee.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: