mounting_sdf_folders_on_a_netbsd_local_machine_via_mount_psshfs
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
mounting_sdf_folders_on_a_netbsd_local_machine_via_mount_psshfs [2021/03/22 05:35] – created hc9 | mounting_sdf_folders_on_a_netbsd_local_machine_via_mount_psshfs [2021/03/22 05:41] (current) – [Mounting SDF Folders on a NetBSD Local Machine via mount_psshfs(8)] hc9 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Mounting SDF Folders on a NetBSD Local Machine via mount_psshfs(8) ====== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== What is mount_psshfs(8) ? ==== | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | ==== Creating basic psshfs mounts: ==== | ||
+ | |||
+ | You'll likely need root permissions to run mount_psshfs(8); | ||
+ | |||
+ | **ex.1)** create a basic read-only mount of an SDF user's $HOME directory under /mnt: | ||
+ | |||
+ | < | ||
+ | sudo mount_psshfs -o ro sdf_user@freeshell.org /mnt | ||
+ | sdf_user@freeshell.org' | ||
+ | </ | ||
+ | |||
+ | Use the mount(8) command to see what the mount looks like: | ||
+ | |||
+ | < | ||
+ | mount -t puffs\|psshfs | ||
+ | sdf_user@freeshell.org on /mnt type puffs|psshfs (read-only) | ||
+ | </ | ||
+ | |||
+ | **ex.2)** mount sdf_user@freeshell.org/ | ||
+ | |||
+ | < | ||
+ | sudo mount_psshfs -O Compression=yes -O IdentityFile=/ | ||
+ | </ | ||
+ | |||
+ | For help setting up public key authentication see the [[: | ||
+ | |||
+ | **ex.3)** put the above in /etc/fstab; mount to local /puffsmnt: | ||
+ | |||
+ | < | ||
+ | sudo mkdir /puffsmnt | ||
+ | |||
+ | sudoedit /etc/fstab | ||
+ | ... | ||
+ | # psshfs PUFFS mount of gopher dir on sdf_user@.sdf.org | ||
+ | sdf_user@sdf.org:/ | ||
+ | |||
+ | sudo mount /puffsmnt | ||
+ | </ | ||
+ | |||
+ | ==== Fixing the displayed file permissions with **mount_umap(8)** ==== | ||
+ | |||
+ | With the above examples you'll probably notice that the UID:GID values for the psshfs mount are either numerical values or otherwise not what you might expect; this is because your local system doesn' | ||
+ | |||
+ | **ex.5)** mount /puffsmnt to ~local_user/ | ||
+ | |||
+ | First, we find who's who on local system (note: UID/GID are fields 3 & 4): | ||
+ | |||
+ | < | ||
+ | ls -dnl /puffsmnt | ||
+ | drwxr-xr-x | ||
+ | |||
+ | grep local_user /etc/passwd | ||
+ | local_user: | ||
+ | </ | ||
+ | |||
+ | From above we see that we need to re-map local UID 1000 to 012345, and local GID 100 to 550. We just have one remapping each so the uid-mapfile and gid-mapfile files get made like so: | ||
+ | |||
+ | < | ||
+ | sudoedit / | ||
+ | 1 | ||
+ | 1000 012345 | ||
+ | |||
+ | sudoedit / | ||
+ | 1 | ||
+ | 100 550 | ||
+ | </ | ||
+ | |||
+ | Now we make the ~local_user/ | ||
+ | |||
+ | < | ||
+ | mkdir ~local_user/ | ||
+ | sudo mount_umap -o nocoredump -g / | ||
+ | </ | ||
+ | |||
+ | Use mount(8) and ls(1) to see what the umap mount looks like: | ||
+ | |||
+ | < | ||
+ | mount -t umap | ||
+ | /puffsmnt on / | ||
+ | |||
+ | ls -dl ~local_user/ | ||
+ | drwxr-xr-x | ||
+ | </ | ||
+ | |||
+ | Alternately, | ||
+ | |||
+ | < | ||
+ | sudoedit /etc/fstab | ||
+ | ... | ||
+ | /puffsmnt / | ||
+ | |||
+ | sudo mount ~local_user/ | ||
+ | </ | ||
+ | |||
+ | ==== Unmounting umap and psshfs mounts: ==== | ||
+ | |||
+ | Unmount umap and psshfs mounts in the usual way with umount(8), but do it in //reverse// order: | ||
+ | |||
+ | < | ||
+ | sudo umount ~local_user/ | ||
+ | sudo umount /puffsmnt | ||
+ | </ | ||
+ | |||
+ | ==== References: ==== | ||
+ | |||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | $Id: psshfs.html, | ||