collection of bash scripts to manage ldap users and groups

theo 93da9bfbfb Changes to createperson 2 yıl önce
.env.example 4f2cebad20 Actually added LDAPOPTS (see previous commit) 2 yıl önce
.gitignore 8e2484f980 Initial commit 2 yıl önce
README.md 1f61d9a53c fixed spacing in README 2 yıl önce
addtogroups d4d0c6f77c Fixed addtogroups not adding users to posix groups 2 yıl önce
creategroup 5b36d3f832 Fixed creation of non posix groups 2 yıl önce
createperson 93da9bfbfb Changes to createperson 2 yıl önce
funcs 755aa483c5 Delete user from posixGroups when deleting the user 2 yıl önce
person2posix 21b40d860f Fixed typo 2 yıl önce
removefromgroups 0c49211a13 Fixed removefromgroups not removing users from posix groups 2 yıl önce
removeperson 755aa483c5 Delete user from posixGroups when deleting the user 2 yıl önce

README.md

Configuration :

Copy the configuration file :

cp .env.example .env

Then, edit .env and set the correct values

Usage

  • createperson

This script doesn't take any arguments. Instead, it will ask you to enter the necessary info. It also asks you if the user should be a posixAccount and for any groups you want to add them to.

  • removeperson

Removes a user from the directory, including the corresponding posixGroup if the user is a posixAccount.

./removeperson uid
  • creategroup

Since adding the first user needs to be done at the creation of the group, a valid uid needs to be passed to the script.

The optional -p flag must be passed as the first argument. It indicates that the group to be created is a posixGroup. Therefore, the first user also need to be a posixAccount.

./creategroup [-p] uid group
  • addtogroups and removefromgroups

Adds a user to one or more groups. User's uid must be the first argument. Posix and non-posix groups can be given, but if posixGroups are given, the user need to be a posixAccount.

./addtogroups uid group1 [group2, group3,  ...]
./removefromgroups uid group1 [group2, group3,  ...]
  • person2posix

Converts an inetOrgPerson account to a posixAccount.

./person2posix uid