19

My school has a computer lab full of machines running Red Hat Linux. They have it set up so that you can log into any computer in the lab, and it automatically loads your desktop, home directory, etc, which makes it so all computers in the lab look the same to you, regardless or which one you're using.

I have two computer at home running Ubuntu Linux. Could I do this same thing with my computers at home? What's it called, and how do I find documentation on how to set it up? Thanks!

2 Answers 2

11

For a small environment at home, you can do the same thing without a full-blown Directory Services server like LDAP or NIS.

Simply create user accounts with the same user name, userid and group id on all systems. Pick one system to host home directories, and use autofs on the other system to mount these directories over NFS.

This gives you most of the benefit of directory services without the effort. Maintenance is quite tolerable as long as you keep it down to a few users and a few computers. Once it scales to classroom size, with annual student turnover, you need to move to the directory services level as described so well by quack quixote.

3
  • does this mean that the system which hosts the home directories would need to be running in order for the second machine to be able to allow users to log in using those directories? or will each machine get its own copy which will be synchronized later?
    – John Kube
    Apr 28, 2010 at 22:00
  • @John: yep, if you're mounting user directories from another system over the network, the system doing the serving will need to be on. Apr 28, 2010 at 22:37
  • @John, yes. Running a directory server also means that system always has to be up. An NFS server can be as simple as an external hard disk with Ethernet interface (such as LaCie or Argosy make) or a one-disk NAS. The ones I worked with also have Samba for Windows share.
    – kmarsh
    Apr 29, 2010 at 11:56
8

You're referring to directory services. There are several systems that can provide this functionality. DNS is probably the best-known type of directory service; this is how your computer translates domain names (www.example.com) into IP addresses (111.000.111.000).

Hesiod is one of the oldest directory services; it took the DNS concept and applied it to information that changes frequently, like users, groups and passwords. NIS and NIS+ (Network Information Service aka YellowPages/YP, developed by Sun Microsystems) is another system common to many Unixen; LDAP (Lightweight Directory Access Protocol) is a newer system. Microsoft provides a system called Active Directory with Windows Server, and Apple provides a service called Open Directory with OS X Server.

On Unix and Unix-like systems these services are usually configured through the NSS (Name Service Switch) configuration, /etc/nsswitch.conf. You can use any of the systems mentioned earlier; to set them up, you'll need to (a) install the service server; (b) configure the backend database; (c) install the client software; and (d) make sure your nsswitch.conf is configured properly. For example, these lines in nsswitch.conf tell the system to (a) try accessing local files first, and then (b) attempt an LDAP query if the first fails:

passwd: files ldap
shadow: files ldap
group: files ldap
hosts: files ldap

I've asked a related question looking for basic how-to-configure-LDAP instructions, but it's unanswered at the moment. Directory services are more often used in business environments than the home, so Server Fault has a wider variety of questions on most of these systems.

1
  • +1 for asking on Server Fault. But yeah, this method in a small, home environment is like shooting a fly with a cannon.
    – petersohn
    Apr 28, 2010 at 21:48

You must log in to answer this question.