Creating Portable Desktops

Creating Portable Desktops

Linux is an operating system that was born on the Internet, so it is not surprising that it has strong networking capabilities. This makes Linux an excellent server, but it also allows Linux to be an excellent desktop workstation, especially in a highly networked environment. Red Hat Linux lets you easily set up your users with a portable desktop that follows them from computer to computer. With other leading desktop operating systems, it is not nearly as easy.

Normally, a Red Hat Linux user's home directory is located within the /home directory. As an alternative, within the home directory you can create a directory named after the system's host name. Within that directory, create the users' home directories. Thus, on a Linux system named dexter, the user mary would have a home directory of /home/dexter/mary instead of /home/mary. There is a very good reason for doing this.

If you are logged into the Linux system ratbert and wish to access your home directory on dexter as if it were stored locally, the best approach is to use Network File System (NFS) to mount dexter's /home directory on the /home on ratbert. This results in having the same contents of your home directory available to you no matter which machine you log in to.

Cross-Reference?

You can read more about NFS in Chapter 18.

To mount dexter's /home directory as described, you would add a line similar to the following in ratbert's /etc/fstab file:

dexter:/home /home nfs defaults 0 0

You would also add an entry such as the following in dexter's /etc/exports directory:

/home ratbert

Now, when ratbert boots up, it automatically mounts dexter's home partition over the network. This enables us to treat the remote files and directories on dexter's /home as if they are locally stored on ratbert. Unfortunately, this has the side effect of "covering up" ratbert's actual /home directory.

This is where the extra directory level based on the system name comes to the rescue. With all of dexter's home directories located in /home/dexter and all of ratbert's home directories located in /home/ratbert, we can remove the danger of one system covering up the home directories of another. In fact, let's take this example one step further: Imagine a scenario in which the systems dexter, ratbert, and daffy all have portable desktops that are shared with the other systems. The /etc/fstab and /etc/exports files for each system should have the following lines added to them.

The /etc/exports and /etc/fstab files for dexter are as follows:

/etc/exports file

/home/dexter ratbert,daffy

/etc/fstab file

Ratbert:/home/ratbert /home/ratbert nfs defaults 0 0
Daffy:/home/daffy     /home/daffy   nfs defaults 0 0

The /etc/exports and /etc/fstab files for ratbert are:

/etc/exports

/home/ratbert dexter,daffy

/etc/fstab

dexter:/home/dexter /home/dexter nfs defaults 0 0
daffy:/home/daffy   /home/daffy  nfs defaults 0 0

The /etc/exports and /etc/fstab files for daffy are:

/etc/exports

/home/dexter ratbert,dexter

/etc/fstab

Ratbert:/home/ratbert /home/ratbert  nfs defaults 0 0
Dexter:/home/dexter   /home/dexter   nfs defaults 0 0

As you can see, each system uses NFS to mount the home directories from the other two systems. A user can travel from server to server and see exactly the same desktop on each system.




Part IV: Red Hat Linux Network and Server Setup