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

Recently i have apply NIS in our testing environment in order to get more control and centralized password management for user in the server.But when I'm finished implementing the NIS,I'm facing some issues.The issues are :

1.How to add existing user into NIS? For example,Let say I have two servers named NIS server and NIS client.If there are existing user in NIS client,can we add it to NIS map in NIS server?or do we need to create these user manually? I can manually add the credential for the user manually but it is not convenient for me to write again all hundred of the users in the system.

2.Is there any way to devide the user to several group? We want to restrict some user to only access some server.Could we do that in NIS?

I've tried to do some research regarding this issue,but it seems that there are lacking documentation for NIS in centos.Any help really appreciated.Thanks.

share|improve this question
    
I would strongly advise using something other than NIS (think LDAP, and poke around at some of the questions here). If you are stuck with NIS though I recommend that you get a copy of Managing NFS and NIS –  voretaq7 Aug 16 '12 at 3:29
    
I'm using NIS as it is simple and easy to configure.but nevertheless I will try to do some research in LDAP. –  user119720 Aug 16 '12 at 3:48
1  
LDAP is a much better way to go. NIS is inherently insecure and not as flexible. Yes NIS is dead easy when compared to LDAP. RHDS (Red Hat Directory Server) is a good LDAP server, or the upstream project 389 Directory Server. –  Red Tux Aug 16 '12 at 4:10

1 Answer 1

1.How to add existing user into NIS?

You add the user to the appropriate passwd file on the NIS server. This may be /etc/passwd on the server, but it may also be another location depending on your configuration. If a user exists on a client system and you want to add them to the global NIS account database, you will probably need to:

  • Remove them from the client.
  • Add them on the server.
  • Rebuild and push your NIS maps.

I can manually add the credential for the user manually but it is not convenient for me to write again all hundred of the users in the system.

Assuming unique usernames and user ids, you could just concatenate all your passwd files together, strip out the system accounts, and add them to your NIS server. If your clients are using shadow passwords (/etc/shadow) you'll need to extract those, too.

2.Is there any way to devide the user to several group? We want to restrict some user to only access some server.Could we do that in NIS?

Sure, NIS offers groups similar in function and behavior to your local /etc/groups file. Just add the users to the appropriate groups in the groups source file on the NIS server, then rebuild and push your maps.

share|improve this answer
    
I think the functionality they're looking for (restricting a group of users to a specific set of machines) might be better accomplished using netgroups and the +@syntax. –  voretaq7 Aug 16 '12 at 3:28
    
Maybe. We found it more convenient to abandon netgroups in our environment in favor of groups and pam_listfile, since this meant we didn't need to replicate access groups as both "standard" groups and as netgroups. –  larsks Aug 16 '12 at 3:29
2  
How embarassing. I've as much as admitted that I'm still running NIS. –  larsks Aug 16 '12 at 3:30
    
...and pam_listfile :-) Though the double-maintenance of netgroups was always a headache in my NIS days –  voretaq7 Aug 16 '12 at 3:38
    
@larsks based from your answer it seems i DO need to manually add into global NIS account database is it? –  user119720 Aug 16 '12 at 3:53

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.