In this example I am going to setup a shared home directory to hold user homes. You would typically use this if you are using a
centralised LDAP server to authenticate users.
Pre-requisites:
A standard Ubuntu server with working network and pingable by name.
You have relocated your local "sudo" user out of the default /home directory.
Configure the Server.
Note:
We are going to use an NFS server to centrally locate our users home directories. Build or select one of your existing Ubuntu servers to act as the host.
My server is called nfs.tuxnetworks.com and I have made sure that it can be pinged by name by my LAN clients.
Login to your NFS server as root;
Install the server software;
~# apt-get install nfs-kernel-server
Create a folder for the user home directories;
~# mkdir -p /store/ldaphomes
To export the directory edit your exports file;
~# vi /etc/exports/
Add this line;
/store/ldaphomes *(rw,sync,no_subtree_check,no_root_squash)
Restart the NFS server;
~# service nfs-kernel-server restart
Configure the Client.
Install the NFS client;
~# apt-get install nfs-common
We are going to mount our NFS share on /home;
Note:
If you have any home directories in /home, these will become hidden under the mounted directory. Ideally there will be no existing users in /home because you will have shifted your local admin user somewhere else.
Edit your fstab file;
~$ sudo vi /etc/fstab
Add a line like this;
nfs.tuxnetworks.com:/store/ldaphomes /home nfs defaults 0 0
Note:
If your /home directory was already being mounted to a block device then you should comment this entry out in your fstab file.
Mount the directory;
~$ sudo mount /home
You can check that it has worked using the df command
nfs:/exports/ldaphomes
961432576 153165824 759428608 17% /home
And thats it!