===== Mounting SDF Folders on a NetBSD Local Machine via mount_psshfs(8) =====
----
==== What is mount_psshfs(8) ? ====
[[http://netbsd.org/|NetBSD]] has its own implementation of [[http://fuse.sourceforge.net/|FUSE]] called ReFUSE(3); mount_psshfs(8) creates sshfs mounts via PUFFS(4) (Pass-to-Userspace Framework File System). See the respective manpages and References section for details.
==== Creating basic psshfs mounts: ====
You'll likely need root permissions to run mount_psshfs(8); examples below assume the sudo(8) tool is installed.
**ex.1)** create a basic read-only mount of an SDF user's $HOME directory under /mnt:
==== 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't have mappings for the remote UID:GID (what you're seeing) to the local system. If you like, you can create a local //sub-tree// of the puffs mount with re-mapped UID:GID values using mount_umap(8). The following example creates two mapfiles (must be root owned) and a new mount point under the local user's $HOME directory and mounts /puffsmnt from ex.4 above:
**ex.5)** mount /puffsmnt to ~local_user/puffy with local_user:users permissions:
local_user:*:1000:100:Loco User ,Seattle,WA ,:/home/local_user:/bin/ksh
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 /uid-mapfile
1
1000 012345
sudoedit /gid-mapfile
1
100 550
Now we make the ~local_user/puffy dir and mount the umap sub-tree of /puffsmnt on it: