Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've setup NIS on Centos 5.3 following the fairly sketchy documentation online, it seems to be working pretty well, however whenever I run ypcat passwd, either from the server or the client, no entries are ever returned.

There's definitely some entries in the /etc/passwd file on the server and I've run ypinit, as well as tried running make in /var/yp to rebuild the database.

ypcat hosts works fine, I get the hosts file from the server, I don't get any errors in the log. Both machines are setup to in nsswitch.conf to read from NIS as well as files.

Any ideas why this wouldn't be working?

share|improve this question
    
You might consider using likewise open for authentication. I have NIS in my production environment and personally I find it to be hell, but I am sure others use it successfully. You can find people's opinions on the topic in other serverfault questions. –  Kyle Brandt Jun 15 '09 at 22:21
    
I'd add another vote for not using NIS. NIS is falling out of favour. Unless you have legacy servers, you'd be better off using LDAP. There's a lot more documentation and more people are using it and have experience of it. –  David Pashley Jun 15 '09 at 23:22
    
I'm not planning on using it in production, just in a smallish test environment. –  JamesHannah Jun 16 '09 at 8:32

3 Answers 3

Have you configured /etc/nsswitch.conf? It should contain lines such as:

passwd:     files nis
group:      files nis
share|improve this answer
    
Yeah - it's exactly as you've written it there. –  JamesHannah Jun 15 '09 at 21:47

Have you tried:

ypcat passwd.byname

or

ypcat passwd.byuid

Also, on your NIS server are there db files for the passwd map?

share|improve this answer
    
Both return nothing, there are passwd.byname and passwd.byuid files in /var/yp/internal, also more annoyingly, when I make a change to the passwd file and then run make in the /var/yp directory, the passwd files do get updated, however there's still nothing returned from ypcat. Might also add I tried adding "+::::::" to the end of the passwd file with no effect. –  JamesHannah Jun 15 '09 at 21:58
    
Are you sure it is grabbing your /etc/passwd for building the map? Have you queried the actual db files created in /var/yp/internal/passwd.byname? –  TCampbell Jun 15 '09 at 22:39
up vote 1 down vote accepted

OK, so this is a bit of a facepalm moment, NIS doesn't show any users with UIDs <500 in it's passwd export, I hadn't added any non-privileged users to the VM I was testing it on. all works fine now :-S

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.