Skip to content

Instantly share code, notes, and snippets.

@fahadsadah
Forked from sarahhodne/addaccesservice.sh
Created September 19, 2010 08:06
Show Gist options
  • Save fahadsadah/586556 to your computer and use it in GitHub Desktop.
Save fahadsadah/586556 to your computer and use it in GitHub Desktop.
#!/bin/sh
HOSTNAME=$(hostname)
USER=$1
/usr/bin/ldapmodify <<LDIF
dn: cn=atd,cn=svcAccess,cn=${HOSTNAME}.cluenet.org,ou=servers,dc=cluenet,dc=org
changeType: modify
add: member
member: uid=${1},ou=people,dc=cluenet,dc=org
LDIF
/usr/bin/ldapmodify <<LDIF
dn: cn=cron,cn=svcAccess,cn=${HOSTNAME}.cluenet.org,ou=servers,dc=cluenet,dc=org
changeType: modify
add: member
member: uid=${1},ou=people,dc=cluenet,dc=org
LDIF
/usr/bin/ldapmodify <<LDIF
dn: cn=login,cn=svcAccess,cn=${HOSTNAME}.cluenet.org,ou=servers,dc=cluenet,dc=org
changeType: modify
add: member
member: uid=${1},ou=people,dc=cluenet,dc=org
LDIF
/usr/bin/ldapmodify <<LDIF
dn: cn=mail,cn=svcAccess,cn=${HOSTNAME}.cluenet.org,ou=servers,dc=cluenet,dc=org
changeType: modify
add: member
member: uid=${1},ou=people,dc=cluenet,dc=org
LDIF
/usr/bin/ldapmodify <<LDIF
dn: cn=passwd,cn=svcAccess,cn=${HOSTNAME}.cluenet.org,ou=servers,dc=cluenet,dc=org
changeType: modify
add: member
member: uid=${1},ou=people,dc=cluenet,dc=org
LDIF
/usr/bin/ldapmodify <<LDIF
dn: cn=sshd,cn=svcAccess,cn=${HOSTNAME}.cluenet.org,ou=servers,dc=cluenet,dc=org
changeType: modify
add: member
member: uid=${1},ou=people,dc=cluenet,dc=org
LDIF
/usr/bin/ldapmodify <<LDIF
dn: cn=su,cn=svcAccess,cn=${HOSTNAME}.cluenet.org,ou=servers,dc=cluenet,dc=org
changeType: modify
add: member
member: uid=${1},ou=people,dc=cluenet,dc=org
LDIF
/usr/bin/ldapmodify <<LDIF
dn: cn=sudo,cn=svcAccess,cn=${HOSTNAME}.cluenet.org,ou=servers,dc=cluenet,dc=org
changeType: modify
add: member
member: uid=${1},ou=people,dc=cluenet,dc=org
LDIF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment