As always, I suggest that you read through the entire lab before you get started!
As root, download the source (don't bother with any patches for now); uncompress and extract the files from the tar archive. View the README file for instructions on how to configure, compile, and install the software. The default installation will put system libraries into /usr/local/lib, which is apparently not searched by default. In my installation, I moved all of the liblufs* files from /usr/local/lib into /usr/lib before the system would work.
Test your installation. Create /mnt/ftp and /mnt/ssh directories on which we will mount new filesystems. First check the ftp filesystem support. Try, for example:
mount -t lufs none /mnt/ftp -o
nosuid,fs=ftpfs,host=ftp.eecs.lehigh.edu,username=anonymous,password=anything,ftpactive
Note the above should be all on one line! If that works, you should now be able to cd to /mnt/ftp/pub and do an ls to see some of the directories available on our ftp server (such as a FreeBSD mirror).
Once you see that the ftp service works, try ssh. With ssh, however, for regular use, you'll want to set up password-less access (using public key authentication, not covered in this class), but for now, you'll find the system asking for your password (perhaps repeatedly). Try
mount -t lufs none /mnt/ssh -o
fs=sshfs,host=mars.eecs.lehigh.edu,username=your-sun-username
Now cd to /mnt/ssh/home/yourid and you'll be in your home directory on the Suns. With this simple arrangement, however, you'll see that the owner and group ids are mapped to daemon on the local system. For a more realistic system, you'd want to map them to a reasonable UID and GID on the local system. However, you now have access. Strangely enough, even if you have both ftp and ssh filesystems mounted, they won't show up with df, but they do with mount.
In class we saw how to set up and use automount, through the use of map files. The lufs project includes two automatic map generation utilities, in /usr/local/bin/auto.ftpfs and /usr/local/bin/auto.sshfs. Therefore, instead of adding a map file to /etc/auto.master, we point to those programs. So, in /etc/auto.master, add the entry:
/autofs/ftp /usr/local/bin/auto.ftpfs uid=1000,gid=1000,--timeout=30
You'll also need to create a new directory /autofs (since we reference it above) for our automatically mounted filesystems. Now (re)start automount using /etc/rc.d/init.d/autofs restart. Now the mount command will show automount as monitoring the ftp subdirectory of /autofs. You can now access any anonymous ftp site, as in:
ls /autofs/ftp/ftp.kernel.org/pub/linux/kernel/v2.6/
If you find it inconvenient to type the full host and path to a common host, you can create symbolic links elsewhere on your filesystem to point to such a file in /autofs/ftp and it will use it automatically.
You can also add a similar statement in /etc/auto.master for ssh, but it isn't useful unless you've created public key authentication in advance.