Today we continue with networking services. In this lab we will configure
our machines as NFS clients and servers, and use automounting.
-
Skipping Classes on March 31/April 1?
I hope so! The hackathon should be great -- lots of mentors, fun, and
more! (Registration is open only until Thursday at midnight.)
Even if you are not participating in the hackathon, you should
come to the Data X Symposium on April 1.
-
Configuring an NFS Server
First, configure your machine to function as an NFS server. We want
to export the contents of /usr/local to any machine on the local subnet
(but not to the world!).
Modify (or create) your /etc/exports file to export /usr/local in a
read-only form to only machines on the CSE/ECE subnet. Tip:
recall from lecture how to view the
export list on other machines.
You'll then need to start or reload your nfs service (same way as other
services we have run in past labs). You and a partner can verify each
other's servers in the next task.
Note that if you have the firewall turned on, it will block NFS access
to your machine (that is, you won't be able to function as a server). You can
turn it off by running system-config-firewall.
-
Configuring an NFS Client
Now set up your machine to function as an NFS client. We want to
mount the contents of a neighboring user's machine's /usr/local to your /mnt
directory. Are you able to see the contents of that drive? Can you
modify the files or directories?
Once you have verified that you are able to mount your neighbor's
filesystem, unmount it, and instead, mount the /usr/local directory from
wume2.cse.lehigh.edu. You'll need to demonstrate this at the end.
-
Automount
In class we saw how to set up and use automount, through the use of
map files found in /etc. In RHEL, automount is enabled by default, and will
automount the filesystems exported by any machine (if permitted) if you
try to access its hostname within the /net/ directory. (This is because
/etc/auto.master is told that /net is handled by /etc/auto.net.)
For example, see what files exist in /net/ and then try:
ls /net/rosie.eecs.lehigh.edu/export/src/bind/
Now what do you see in /net/ ?
You can explore other parts of that filesystem on rosie as well. There are a few
other exported volumes on other machines that are accessible to any host.
Try, for example,
ftp.cse.lehigh.edu.
-
Mounting SMB/CIFS
NFS is not the only mechanism to provide network file access. Windows
boxes natively support access via SMB/CIFS. If you are on-campus, you
can get access to the
home space that appears as a drive on LTS Windows PCs.
[I found this information on
http://www.lehigh.edu/~insna/
where a Mac version is described, and lots of other useful networking info
is placed.]
This access requires authentication using your LTS account and password,
so we want to mount these
manually (substituting your own userid):
mount.cifs //home10.cc.lehigh.edu/A-H /mnt -o "username=ad\bdd3"
If your username doesn't start with an a-h, you need to use a different
home machine, one of:
mount.cifs //home11.cc.lehigh.edu/I-L /mnt -o "username=ad\jmt7"
mount.cifs //home12.cc.lehigh.edu/M-Z /mnt -o "username=ad\ss0k"
You'll be asked for your LTS password, but after that you can cd to
/mnt/bdd3 to see your files (when your home drive is mapped). Note that
files will look like they are all owned by root---to fix this, you'll
need to use uid and gid options in mount to substitute your local account
uid and gids. (It appears that the options for remapping uid and gid might need to be before the username option.)
By default, automount has only one automounted directory enabled --
the /net/ directory you used above. However, it is also able to
access CIFS/SMB filesystems. If you know of any publicly accessible
CIFS/SMB filesystems, you can create a new directory for automounting them
(with appropriate additional configuration for automount). For security,
however, I don't
recommend embedding your username and password in an automount file.
-
Wrapping Up
In order to sign the lab completion sheet,
you will need to:
- show me the output of the command that shows the NSF export list on localhost.
- show me the contents of /usr/local that you automounted from wume2.
- show me that you have (non-root) SMB/CIFS access to your LTS drive.