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

Re: sshfs has fubared mount



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 (?).


My username 'dpchrist', UID, groupname 'dpchrist', and GID are the same on all of my machines.


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


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:

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 ..


I use mount(8) to mount the remote filesystem:

2021-02-08 22:42:15 dpchrist@tinkywinky ~
$ mount /po

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,user=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


David


Reply to: