Link to home
Start Free TrialLog in
Avatar of packratt_jk
packratt_jkFlag for United States of America

asked on

Can't log on to NIS

Ok, I setup and NIS server and one client.  The client binds to the domain ok, but when I try to login with an nis user name/password, it says:

Session setup problem, abort.

Any idea what this is or how to fix it?
Avatar of ahoffmann
ahoffmann
Flag of Germany image

what does  ypwhich  report on the client?
what are the entries for passwd and shadow in /etc/nsswitch.conf?
Avatar of jlevie
jlevie

That sounds supiciously like a permissions problem on the user's home dir that's preventing some part of the X startup form completing. Can this user log in on the clinet from the console and if so do they have a home dir and can write to it? Is your NIS environment using auto mounted home dirs?
Avatar of packratt_jk

ASKER

ypwhich reports the ip address of the nis server.
/etc/nsswitch.conf (client) is as follows:

passwd: compat
shadow: compat
group: compat
hosts: nis files dns
networks: nis files dns
ethers: nis files
protocols: nis files
rpc: nis files
services: nis files

The same problem happens when I try to login to a console.  The users do not have a home directory on the client, so it looks like jlevie is on the right track.  I assume in this case that I should mount /home  on the nis server to /home on the clients but how?  NFS??

Please explain how I set this up.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok, that makes sense, but where do I make the auto.home map and how do I force the NIS server to use it?
> .. do I make the auto.home map and how do I force the NIS server to use it.

simply add a line like follows to /etc/auto.net (assuming that auto.net is used in /etc/auto.master):

/home -fstype=nfs your-server:/exported/share/name/for/home

(I recommend to remove the x-bits from all /etc/auto.* files, except you know what you're doing:)
Then restart autofs.

When you say "force the NIS server to use it", do you mean the auto.net file, or the /home directory?
For /home directory, see above.
Ok, I assume I'm editting these files on the clients, but I can't seem to be able to find them anywhere, on the clients or on the server.  I don't seem to have any /etc/auto* files at all, nor am I able to find an autofs program.
sounds like there is no automounter installed.
I suggest to use simple mount, just add an appropriate line to /etc/fstab, then mount it.
Ok, I read in the NFS how to that I can just add the entry to /etc/fstab.  Is there any downside to doing it that way?
Well, I added the entry to fstab and I can now see the mapped /home drive, but the directories there (one per user) are not accessible (permission denied).  What am I missing here?
Mounting the server's export via fstab will work, but it isn't very flexible in that it's not easy to use multiple file servers. There's also the problem of clients hanging at boot or shutdown if the server isn't up and running at that time (using intr on the mount flags helps). Using an auto.home map and autofs on the clients is the classic solution, which avoids those complications.

In an auto.home scenario one normally stores user dirs on a mount point other than /home. Personally I use /nfs0, /nfs1, etc. On the server /home is simply a directory for the automounter to use. The home dir area(s) are exported out to all clients with:

/nfs0    (rw,root_squash)

If you are in a less than trustworthy environment you may wish to impose access restrictions to just those system that are members of the NIS domain. That's easy to do with netgroups.

The auto.home file contains an entry for each user like:

user1     server:/nfs0/user1-dir
user2     server:/nfs0/user2-dir

And there are other things one can do there. For example I maintain a PD source repository that I'd like to be able to access on multiple systems. It lives on a another system, not the file server, so my auto.home contains:

user1     server.dom.tld:/nfs0/user1-dir
user2     server.dom.tld:/nfs0/user2-dir
src       other-box.dom.tld:/nfs1/sources

Since all of this is "smoke and mirrors", no changes on the client are required if something needs to be moved from one server to another. Just change move the data, change the auto.home map and the clients see it.

   
ok, so the auto.home map is on the server and gets pushed to the nis clients?
Ok, let me see if i understand this.

1) add the auto.home map to the nis server.
2) when a user logs in via nis, the map gets transfered to the client and the appropriate directories automount.

Do i have this right?
I would recommend to have the automounter files *not* handled by NIS, but manage them locally on each client (or simply add one line in /etc/fstab).
If there is a problem in NIS or automounter, you're searching a long time for the reason, usually, believe me .. (it worked fine in homogenous SunOS and/or Solaris, but Linux is a bit nasty here)
packratt_jk,

Right, you modify the NIS Makefile to include automount maps and populate the files. Then the NIS clients can automagically see the data. The autofs implementaion in 7.x will look for a NIS map and use that data if it's available. RH 6.2 needs a +auto.home in /etc/auto.home, if memory serves.

ahoffman,

I've got networks using NIS hosted on Solaris, IRIX, and Linux and clients ranging from RH 6.2-7.3beta. We've never had any problem getting the clients to use the NIS automount maps in any of those networks.
jlevie, didn't say that it is impossible in heterogenous networks, just that unexperianced networkers may have difficulties debugging problems ther.
It was just a hint to keep it simple 'til it works.
Sorry for confusion.
Oh, okay. It sounded like you were alluding to some problem with the Linux NIS or autofs that I wasn't aware of. I personally think that it's less of a problem to use a NIS map than it is to use files on the clients. The chances of the various clients getting out of sync with the server(s) is greater and it's not as obvious to the inexperienced what's wrong. And then there's the auto_home/auto.home file name differences on Solaris systems...
well, if there is an experianced admin, agreed ;-)

packratt_jk, sorry for being a bit off-topic
It's ok - sorry for being a little confused.

I understand the concept here, I'm just having problems setting it up.  I understand that I need to have these maps pushed to the clients, but i don't understand how to make these maps or how to have the nis server pass them on to the clients.  Please explain what I need to to on the nis server to make this happen.

Thanks,
pack
>>Right, you modify the NIS Makefile to include automount maps and populate the files.

where is this file and what do I need to change to make automounting work?

>>The autofs implementaion in 7.x will look for a NIS map and use that data if it's available.

I installed RH 7.2 on the clients to ensure this type of operability.


So, I just need to modify the makefile on the server to include automount maps.  Those maps then get pushed to (or pulled from) the nis clients and are automounted.  Right?
on your NIS master (or slave) server you need a database of these files. This database is simply a directory with an Makefile, /var/yp usually (not shure for RH).
In the Makefile you have to specify the maps, how they are generated (Makefile dependencies) and how they are distributed.
You need to deside if you want them to be pushed from NIS server to NIS clients, or pulled by clients from server.
Then you need to initialize the NIS master server, check the files in /var/yp/ (or wherever the database is by default).
what are the advantages/disadvantages of server-push vs client-pull?
Ok, I put the home mappings on the back burner until I can get that figured out.  In the meantime, I mounted manually with a mount command at boot.  The clients can now log in and X boots, but it runs extremely slow.  There doesn't seem to be any extreme amounts of network traffic, yet KDE takes over 5 minutes to boot.  I tried logging in with a non NIS account (root), and everything works normally.  Is nfs just really slow or do I have something setup wrong?
Something is wrong. With the home dir area already mounted logins should be almost as fast with an NFS mounted home as they are to a local disk (assuming a reasonably loaded network).

There could be a network problem and the first thing I'd look at would be to see if I had a link speed/mode mis-negotitation, which can easily happen when you have 10/100 NICs and 10/100 hubs or switches. A quick and dirty (and very reliable) indicator is to attempt an FTP transfer between the server an a client of a 2-5Mb file in both directions. If there's a link problem you'll see very low data rates, usually in the 10's of Kb/sec or lower. On the other hand, if everything is right you should get about 600-800Kb/sec for a 10Mbps link or 6-8Mb/sec for a 100Mbps link.

The fix for a link mis-negotiation problem is to force one or both ends of the link to a fixed speed/mode. Exactly how that's done depends on what NIC's are in use and whether you have a switch (and what kind) or a hub.
Wow, that works great!  I checked ifconfig on the client and it had thousands of bad rx packets, so I swapped out the cable and now it works as expected.  I would still like to get the automounting to work, but I will post that in a different thread.

Thanks!
If I get time in the next day or so I'll document the process that I use to configure NIS for a classical environment with automounted home dirs. I'll post that in this question.
Well, I already posted a new question about that here: https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=linuxnet&qid=20298028

so prolly better to post it there.

Thanks though, I look forward to using the automounting :)