Member since
10-08-2024
2
Posts
2
Kudos Received
0
Solutions
10-15-2024
08:24 AM
1 Kudo
I create my first user with this script #!/bin/bash group='admins' username='admin' uidNumber=1001 gidNumber=1001 firstName='My First' lastName="My Last" password="password" ldapadd -x -D "cn=admin,dc=myhost,dc=dev" -w $password <<EOF dn: ou=$group,dc=myhost,dc=dev objectClass: organizationalUnit ou: $group EOF cat <<EOF dn: uid=$username,ou=$group,dc=myhost,dc=dev objectClass: inetOrgPerson objectClass: posixAccount uid: $username cn: $username sn: $lastName givenName: $firstName uidNumber: $uidNumber gidNumber: $gidNumber homeDirectory: /home/$username loginShell: /bin/bash userPassword: $(slappasswd -s $password) EOF # Ajouter l'utilisateur via ldapadd ldapadd -x -D "cn=admin,dc=myhost,dc=dev" -w $password <<EOF dn: uid=$username,ou=$group,dc=myhost,dc=dev objectClass: inetOrgPerson objectClass: posixAccount uid: $username cn: $username sn: $lastName givenName: $firstName uidNumber: $uidNumber gidNumber: $gidNumber homeDirectory: /home/$username loginShell: /bin/bash userPassword: $(slappasswd -s $password) EOF Authentication Proxy Server not trusted
... View more