On Sun, 2003-03-16 at 21:39, Matthew Saltzman wrote:
> I have a small home network, and I'd like to share home and mail
> directories so that a user logging in on any machine in the network sees
> the /home/<userid> directory from his/her own machine and
> /var/spool/mail/<userid> from a common server.  I think I have the basics,
> but I'd like to make sure I've got it right before I break something I
> care about.  I'd like not to use NIS at the moment, though I may get into
> that later.  There aren't so many machines or users that I feel the need
> for it at this point.

NIS is not the only way to share the user database. LDAP, Hesiod,
Kerberos and SMB are all supported by RedHat Linux. At the simplest
level, you can setup a cron job that pulls
/etc/{passwd,shadow,group,gshadow} from one central server periodically.
For your purposes, the important thing is to have all users map to the
same userID on every machine on your network.

> For a home directory, I know that the machine it lives on must export it
> in /etc/exports:
> 
>       /home/joeuser   192.168.1.0/24(rw,sync)

You would be better off exporting the entire /home directory.

> 
> To get it mounted when the user logs into any machine, I would have that
> user's entry in /etc/passwd be:
> 
>       joeuser:x:500:500:Joe User:<something>:/bin/bash
> 
> but what about <something> reflects the fact that the directory is to be
> mounted from the remote machine on login?  Or am I off base here?

It is the local mount point. It is recomended to make the local mount
points mimic the local mount points in the NFS server.

> For the mail files, I have the server export /var/spool/mail as:
> 
>       /var/spool/mail 192.168.1.0/24(rw,sync)
> 
> and I mount it with the entry in /etc/fstab
> 
>       server:/var/spool/mail    /var/spool/mail         nfs     \
>                                       auto,hard,intr,rw       0 0
> 
> This seems straightforward except for one thing:  root's mail file is now
> network-mounted so all mail to root on any machine will go to the same
> mail file.  Thus (1) I won't be able to tell which machine generated
> the mail, and (2) since I'm not NFS mounting /root, when I read that mail,
> the mbox file it ends up in will depend on which machine I'm logged into.
> Is there a way around that difficulty?

As for your concerns,

(1) Yes you will, because each machine's mail system will add headers
which will tell which machine generated the message.

(2) There is nice little program called unison that is similar to rsync,
but does bidirectional synchronization. You could use it to sync
/root/mbox periodically. You could solve both problems instructing your
MTA to use procmail as an MDA and create a /root/.procmailrc stating
that delivery should go directly to /root/mbox instead of
/var/spool/mail/root. If you do this, remember to change the value of
$MAIL.

Much more of a concern is the problem with mailbox locking. The mbox
format is quite bad at handling race conditions. For this reason, I
would recomend you investigate on MTA and MUA software that has support
for the MailDir message format (IIRC, postfix and mutt both have support
for MailDir). If you configure your system so that mail is delivered to
$HOME/MailDir/..., you won't even have to export /var/spool/mail.

Cheers,
-- 
Javier Gostling                        Av. Kennedy 5757, of. 1502
Ingeniero de Sistemas                  Las Condes, Santiago, Chile
Virtualia S.A.                         Fono: +56 (2) 202-6264 x 130
[EMAIL PROTECTED]                 Fax:  +56 (2) 342-8763



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to