Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NIS home directories

110 views
Skip to first unread message

MChez

unread,
Feb 3, 2004, 6:16:06 PM2/3/04
to
I posted a question about NIS distributed home directories a few days ago but I am still lost. I am a new user of Linux and I am finding it difficult to find information on a few questions.

As I understand a pure Linux NIS network, the users are created on the NIS server. Therefore the user’s home directories are also created on the server and the client machine mounts these directories during the login process. Is this correct?

When I created a new network domain called “computing.net” and installed SFU 3.5, the creation of new users on the server creates the home directories on a DFS partition I called “Home Directories”. Should windows link the home directories created on the server to the NIS user when I edit the UNIX Attributes under properties for that user?

The server is called “Nile” and the NIS domain is “computing”. If it is possible to use the distributed home directories on the server, would the entry for the “home directory” field in the UNIX Attributes under properties be

//Nile/Home Directory/%username%

I have tried this and many other possible variants but I am always prevented from login on to Redhat Linux 9 because it can not find the directory for the user. I think that it is only looking at its own local files.

Where am I going wrong? Surely I can’t be expected to create separate directories on all of the Linux machines for every user?

"Martin v. Löwis"

unread,
Feb 4, 2004, 12:34:46 AM2/4/04
to
MChez wrote:

> As I understand a pure Linux NIS network, the users are created on
> the NIS server. Therefore the user’s home directories are also
> created on the server and the client machine mounts these directories
> during the login process. Is this correct?

Not at all. In Unix, users are never created. Instead, account
names get associated with uids, and home directory locations, and
login shells. The home directory location is a "path". It can
be any path, such as /tmp/this_is_john. A passwd entry would then
read

john:passwd:4000:100:John User:/tmp/this_is_john:/bin/sh

Make sure you understand the meaning of all the fields in this
line.

This passwd entry could live either in /etc/passwd, or in a NIS
passwd map. When user john logs in, the local machine goes to
the NIS server and fetches john's NIS entry. The local system
uses this to:

1. verify the password,
2. make john's home directory the working directory of the
login process (and set the HOME environment variable), and
3. invoke the login shell

This is all done on the local machine, so the home directory
path is always evaluated on the local machine.

It is typically desirable that a user has the same home directory
on all machines. So using /tmp/this_is_john is undesirable (not
impossible). If the passwd entry is in NIS, you would typically
want to put something like /homedirectories/this_is_john into
the NIS entry, and make sure /homedirectories is NFS-mounted
(or a symlink to something NFS-mounted).

> When I created a new network domain called “computing.net” and
> installed SFU 3.5, the creation of new users on the server creates
> the home directories on a DFS partition I called “Home Directories”.
> Should windows link the home directories created on the server to the
> NIS user when I edit the UNIX Attributes under properties for that
> user?

This is your choice. You need to set the Unix home directory path
of the user to a path that is valid on all systems where the user
wants to login. For that, you must

1. decide what folder on what computer should be the home directory
of the user.
2. NFS-export this folder or one of its parent folders.
3. NFS-mount the exported folder on all clients (e.g. using
automount)
4. Put the *local* path of the home directory into the NIS
home directory path.

> The server is called “Nile” and the NIS domain is “computing”. If it
> is possible to use the distributed home directories on the server,
> would the entry for the “home directory” field in the UNIX Attributes
> under properties be
>
> //Nile/Home Directory/%username%

No. NIS home directory paths are always local paths, on the local
machine where the user logs on (unless the local machine has a namespace
escape mechanism, such as AFS, which is irrelevant for your case).

> I have tried this and many other possible variants but I am always
> prevented from login on to Redhat Linux 9 because it can not find the
> directory for the user. I think that it is only looking at its own
> local files.

Yes, certainly. This is intentional.

> Where am I going wrong? Surely I can’t be expected to create separate
> directories on all of the Linux machines for every user?

You are precisely expected to do something like this. The trick
is that you would not *create* those directories, but NFS-*mount*
them.

Regards,
Martin

MChez

unread,
Feb 4, 2004, 5:31:05 AM2/4/04
to
Thanks Martin, I will give that a go this evening and let you know how it went.

Mark.

MChez

unread,
Feb 4, 2004, 3:21:09 PM2/4/04
to
That’s better. I had a lot of trouble with the permissions in both Windows and Redhat, but at least I can log in as a user now.

I forgot to change the default shell at first and Redhat went mad. No writing would show up and the screen was populated with unreadable error messages. Every time I log onto that machine now, it does the same but the rest are fine. It’s no problem since I will just re-install Redhat.

Thanks for the help Martin.

Mark

0 new messages