Add users to groups with ldap

 in

I need to add an existing user to an existing group with my new ldap setup, which is running on a Debian lenny server. Here's what I've got for an ldif file:

dn: cn=johnstones,ou=Groups,dc=newcrossroads,dc=net
changetype: modify
add: uniquemember
uniquemember: cn=jess

and here is my command and output:

robert:~# ldapmodify -x -D cn=admin,dc=newcrossroads,dc=net -W -f /var/tmp/adduser.ldif
Enter LDAP Password:
modifying entry "cn=johnstones,ou=Groups,dc=newcrossroads,dc=net"
ldap_modify: Object class violation (65)
additional info: attribute 'uniqueMember' not allowed

I've also attempted to do the job with ldapscipts with the following results:

robert:~# ldapaddusertogroup jess johnstones
Group johnstones not found (or jess already member of johnstones)

That last in particular confuses me; the group exists and every attempt I've made to add the user has failed. So two questions:

How do I write a proper ldif file to add a user to a group?

How do I view group membership?

Please bear in mind that I really don't know what I'm doing. I got ldap running more through good luck than good practices. Unfortunately the online guides I've found assume that you do know what you're doing, and I've been fighting with this for three days. Can anyone help?

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix