# Can't add user to NIS group



## mallen324 (Aug 5, 2011)

So there's a local user on one of our servers, let's say _testuser_. When I run 


```
sudo pw groupmod testgroup -M testuser
```

to add testuser to the group, test group, it returns with:


```
pw: group 'prime' not available (NIS?)
```

With the lack of documentation, I don't even know if we have a NIS server. Could you guys point me in the right direction?


Also, I'm running FreeBSD 8.1


----------



## ahavatar (Aug 6, 2011)

There's a section in the handbook: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-nis.html


----------



## mallen324 (Aug 8, 2011)

Thank you for that. It was very informative. I am still a little stuck here, however. Is there a way to find my NIS server on my network, or even figure out if I have one? I recently started a new job and there's no documentation on the setup around here.


----------



## DutchDaemon (Aug 8, 2011)

yp(8) might give you some clues as to where to start looking.


----------



## mallen324 (Aug 8, 2011)

I can see how that would help me. but it is saying "yp: not found" . I appreciate your guys' help so far though. I guess my big thing is that I have this group 'prime' that is not in /etc/groupp. That makes me think it is a NIS group, however, no one here (my office) seems to have even heard of a NIS server. 

Is there some files that would show the IP of the NIS server by any chance? I don't even know if there is one.


----------



## DutchDaemon (Aug 9, 2011)

If you don't have any entries in /etc/passwd that start with a plus sign, e.g.


```
+john:
+::::Guest
+::::::
```

or the same in /etc/groups


```
+:::
```

it's extremely unlikely you are in a NIS domain or even in the vicinity of a NIS server.


----------



## mallen324 (Aug 9, 2011)

Ok. Thank you. I didn't see any entries with a + sign in either file. 

But now my problem is, what/where is this group prime, and how can I add people to it?


----------



## mallen324 (Aug 9, 2011)

Ok So I feel dumb. I looked at the smb.conf file. I guess we have an ldap server. Anyways, for those wondering I was able to find all the commands needed to do my tasks in this part of my smb.conf file:


```
# These scripts are used on a domain controller or stand-alone

# machine to add or delete corresponding unix accounts

  add user script = /usr/local/sbin/smbldap-useradd -m %u

  add group script = /usr/local/sbin/smbldap-groupadd -p %g

  add machine script = /usr/local/sbin/smbldap-useradd -w %u

  delete user script = /usr/local/sbin/smbldap-userdel %u

  delete user from group script = /usr/local/sbin/smbldap-groupmod -x %u %g

  delete group script = /usr/local/sbin/smbldap-groupdel %g
```

Thanks everyone for all your help. Sorry it was such a dumb mistake.


----------

