On Mon, 17 Mar 2003, Javier Gostling wrote:

> 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.

Yes.  In this case, maintaining /etc/passwd and /etc/groups by hand is
adequate for my needs.  Sometime when I have more time I'll look into some
of these alternatives.

>
> > 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.

I see how this would work if all user directories were on a single server.
In my case, Joe User's primary home directory is on his desktop and Jane
User's primary files are on her desktop.  But I want Joe to see his
primary home when he logs into Jane's machine (or any other one on the
LAN) and the same for Jane.  If I just export /home from Joe's machine and
mount it on Jane's, I'll mask her primary home directory.

I'm thinking there might be something that can be done with the
automounter.  So the behavior would be:

        Joe logs into Joe's machine and gets the local /home/joeuser.
        Joe logs into Jane's machine and it automounts Joe's /home/joeuser
                via NFS.  When Joe logs out, the mounted home directory is
                unmounted.
        Jane's userid behaves the opposite.

Can that work?

>
> > 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.

Ah, that would do it.  Thanks.

> 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.

Interesting.  In this very low-traffic environment, I don't think I'm
taking much of a risk.  But I imagine that I could also set up the LAN so
that all mail delivery on the LAN is through the server.  (I'm currently
using sendmail.)

Thanks for your suggestions.

>
> Cheers,
>

-- 
                Matthew Saltzman

Clemson University Math Sciences
[EMAIL PROTECTED]
http://www.math.clemson.edu/~mjs



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

Reply via email to