CPU-LDAP(8)
π CPU-LDAP(8) π
okay so bestie, this is the manual page for cpu β a user administration tool for LDAP backends. Itβs giving sysadmin but make it cute. π
πΈ NAME πΈ
cpu β a user administration tool for LDAP backends.
β¨ SYNOPSIS β¨
cpu user{add,del,mod} [options] login
cpu group{add,del,mod} [options] group
cpu cat
π¦ DESCRIPTION π¦
The ldap module for cpu is literally your girl for administering groups and users that live on an LDAP backend. It tries to keep complete compatibility with the GNU/Linux versions of the shadow utils when it comes to command line options. It also does some extra iconic stuff that traditional user utilities donβt, like letting you pick which hash to use for the user, generating random or linear uidβs and gidβs, and pulling a userβs info from existing password and shadow files. π
π LDAP OPTIONS π
These are the LDAP-server-specific options, bestie. You can mix them with any of the cpu functions. β¨
-2,--2β lowkey makes it use LDAPv2 instead of LDAPv3.-a file,--addfile=fileβ if you hand it a filename, it gets parsed and any extra ldap attributes in that file get added along with the user or group. Warning: this file should not contain any attributes that CPU requires or that you already specified in the config file. If you do that, the modification/addition will fail or create multivalued attributes. The format should be:
<attrdesc>: <attrvalue>
<attrdesc>: <attrvalue>
<attrdesc>:: <base64-encoded-value>
...
-A cn,--cn=cnβ this one tellscpuwhat a userβs dn should look like. If you specify-A foofor some user, their dn will look likefoo=username,.... You can also set this in the config file withUSER_CN_STRING.-B base,--groupbase=baseβ the base to search for groups in. This is required foruseraddand for any group functions. Make it a fully qualified base, likeou=groups,o=company,c=us. This corresponds to theGROUP_BASEconfiguration option.-D bind_dn,--binddn=bind_dnβbind_dnshould be a DN with adequate credentials for the operation youβre requesting. This corresponds to theBIND_DNconfiguration file option.-F[file],--passfile[=file]β if an argument is provided, that file should be in Unix-style password format. If no argument is provided, the config file variablePASSWORD_FILEwill be used. Please be sure that the switch (-For--passfile) has no trailing whitespace β it should be immediately followed by the argument. The information associated with the user will be used for populating their LDAP entry (uid,gid,gecos, home directory, shell). π«Ά-H hash,--hash=hashβhashshould be one ofsha1,md5,ssha1,smd5,crypt,md5cryptorclear. This corresponds to theHASHconfiguration file variable. Select the hash that is being used at your site.-N hostname,--hostname=hostnameβhostnameshould be the hostname running the LDAP service. This may be an IP address or hostname. This corresponds to theLDAP_HOSTvariable in the configuration file.-o,--nonposixβ violate POSIX naming standards and allow characters in user and group names not in the character set[A-Za-z0-9._-]. This is useful for things like adding Samba machine accounts. not me encouraging chaos π-P port,--port=portβportshould be the port that the LDAP server is listening on. This corresponds to theLDAP_PORToption in the configuration file.-R length,--random=randomβlengthshould be the length youβd like a randomly generated password to be. This password will be displayed to the user.-S[file],--shadfile[=file]β if an argument is provided, that file should be in Unix-style shadow format. If no argument is provided, the config file variableSHADOW_FILEwill be used. Please be sure that the switch (-Sor--shadfile) has no trailing whitespace β it should be immediately followed by the argument. The information associated with the user will be used for populating their LDAP entry (password,sp_lstchg,sp_min,sp_max,sp_warn,sp_inact,sp_expire). πΈ-t timeout,--timeout=timeoutβ this value specifies how long (in seconds) before LDAP operations should time out. The corresponding configuration file isTIMEOUT.-U base,--userbase=baseβ the base to search for users in. This is required for any user functions. Make it fully qualified, likeou=users,o=company,c=us. This corresponds to theUSER_BASEconfiguration option.-w[pass],--bindpass[=pass]β if an argument is provided, that value will be used for the bind password. If no argument is provided, the user will be prompted for a password. This option can be omitted by specifying the password in the config file withBIND_PASS. If a value is specified at the command line, the switch should have no whitespace following it.-x,--tlsβ try tostarttlsbefore talking with the ldap server.
The following options can be used for populating LDAP attributes.
-f name,--firstname=nameβnameis used in possible combination with lastname in order to have a more complete CN. This value is also used for thegivenName(gn) attribute. This value is not required by RFC2307.-E name,--lastname=nameβnameis used in possible combination with firstname in order to have a more complete CN. This value is also used for thesurname(sn) attribute. This value is not required by RFC2307.-e address,--email=addressβ the valueaddressis used to populate themailattribute. This attribute is not required by RFC2307 forposixAccountbut many peopleβs LDAP schemas do require it.inetOrgPersonis one object that contains it.
The following options are not LDAP specific.
-h,--helpβ display help. π«Ά-v,--verboseβ turn the verbose level up.-V,--versionβ display the version of the module.
π± cpu cat π±
The cat command will cause any users and groups stored in the LDAP directory to be displayed in a Unix-style format. cat requires no options.
π cpu useradd [options] login π
The useradd function is used to add new users to an LDAP directory. The options are similar to those used by traditional GNU/Linux user administration utilities.
-c comment,--gecos=commentβ the value specified is used to populate thegecosattribute. You can specify a default value in the config file using theGECOSvariable. This is not required by RFC2307. This can also be populated using the-Foption (see above).-d home_dir,--directory=home_dirβ the new user will be created usinghome_diras the value for the userβs login directory. The default is to appendlogintoHOME_DIRECTORY(from the configuration file) and use that as the login directory name. This is required by RFC2307.-g initial_group,--gid=initial_groupβ the group id or name of the userβs initial login group. The group should exist but does not have to. CPU will search the LDAP directory and warn you if that group does not exist. If the group does exist, the userβsgidNumberwill be set to thegidNumberof that group. This is required by RFC2307. If unspecified, CPU will search for the next unused GID. This behavior can be adjusted byMAX_GIDNUMBER,MIN_GIDNUMBER,ID_MAX_PASSES, andRANDOMin the configuration file.-G group,[...],--sgroup=group,[...]β a list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace. CPU will search the directory for these groups, and if found, add the user to those groups. The default is for the user to belong only to the initial group.-k[skeleton_dir],--skel[=skeleton_dir]β this option is only useful if specified along with the-moption. If both are specified, the contents ofskeleton_dirwill be copied to the userβs new home directory. Ifskeleton_diris specified, it should have no whitespace between the command line switch. Ifskeleton_diris not specified, the value ofSKEL_DIRas specified in the configuration file will be used.-m,--makehomeβ the userβs home directory will be created if it does not exist. The files contained inskeleton_dirwill be copied to the home directory if the-koption is used. The-koption is only valid in conjunction with the-moptions. The default is to not create the directory and to not copy any files.-p[passwd],--password[=password]β the encrypted or unencrypted password. If no argument is given, the user is prompted to enter a password. If CPU was compiled withlibcrack, the password will be checked for weakness. If the password is encrypted,hashshould be the value of the hash type that was used. If not specified at the command line or found in the shadow file (if-Swas used),*is used which should lock the account. π-s shell,--shell=shellβ the name of the userβs login shell. If not specified at the command line, one can specify it with theDEFAULT_SHELLconfiguration file option. This is not required by RFC2307.-u uid,--uid=uidβ the numerical value of the userβs ID. This value must be unique, the value must be non-negative. If unspecified, CPU will search for an unused UID. This behavior can be adjusted byMAX_UIDNUMBER,MIN_UIDNUMBER,ID_MAX_PASSES, andRANDOMin the configuration file.-X script,--exec=scriptβ after the user has successfully been added to the directory, execute this script. The script is passed the login name. If this option is not supplied, the configuration file will be checked forADD_SCRIPT.
π cpu usermod [options] login
Okay so usermod is the glow-up command. You're not making a new user, you're giving the existing one a makeover. And here's the tea: every single option that works with useradd also works here β with exactly one exception, and that exception is -k. Not -k, bestie. We don't do -k here. Periodt. β¨
the options, babes
-l login_name,--newusername=login_nameβ full rebrand incoming π The user's name gets switched from login over to login_name. The LDAP attributescnanduidboth get changed tologin_name, and the user's rdn gets modified too. And if you pair this with the-mswitch? Then their old home directory gets copied over to the appropriate new location β peep the-dswitch for how that behavior actually shakes out. (iykyk, read the fine print.)-L,--lockβ locks the given user account. π Not today, hacker.-U,--unlockβ unlocks the given user account. π welcome back, king.
ποΈ cpu userdel [options] login
This one modifies the LDAP directory and deletes all the entries that refer to login. The named user must exist β no ghosting a user who was never there, it's giving error energy. Here are the options that apply to userdel:
-r,--removehomeβ files in the user's home directory get removed right along with the home directory itself. π§Ή But the user's mail spool is not deleted β that survives, untouched. And any files chilling in other file systems? You gotta go search for those and delete them manually, sorry bestie, no shortcut for that one.-X script,--exec=scriptβ once the user has successfully been removed from the directory, run this script. π¬ The script gets the login name passed to it. And if you don't supply this option? Then the configuration file gets checked forDEL_SCRIPTinstead. No cap.
π cpu groupadd [options] group
New group account, who dis? π The groupadd command creates a brand new group account using the values you specify on the command line plus the default values from the configuration file. The new group gets entered into the LDAP directory as needed. Options that apply to groupadd:
-g gid,--gid=gidβ the numerical value of the group's ID. This value should be unique (key word: should, and you know how that goes). The value must be non-negative β no negatives allowed, that's a hard no. And plot twist: you can get a brand new gid generated for you just by not specifying this option at all. That generation can be modified by changing the configuration file. Cute, right? π¦
β¨ cpu groupmod [options] group
This one modifies the group you named on the command line. Options that apply to groupmod:
-g gid,--gid=gidβ the numerical value of the group's ID. This value should be unique. The value must be non-negative. Same rules as always, we're consistent here. π-n group_name,--newgroupname=group_nameβ the group's name gets changed from group to group_name. Thecnand the rdn get modified too. Glow-up complete. πΈ
π cpu groupdel [options] group
And finally, groupdel removes the group you named on the command line from the LDAP directory. That's it, that's the whole vibe. Gone. Bye. π
π SEE ALSO
π AUTHORS
Blake Matheny <bmatheny@purdue.edu> β legend behavior, honestly.
The current version of this software is always available at http://cpu.sourceforge.net π
π BUGS
To report a bug or problem, please e-mail:
cpu-users@lists.sourceforge.net
Do it, bestie, they wanna hear from you π«Ά
π TODO
See the TODO file that accompanied the software. And please β please β e-mail them with any additional suggestions. They're literally asking. Don't leave them on read. π
okay that's the whole page!! every flag, every path, every email, every vibe β all accounted for π
this page is from CPU-LDAP(8), dated 17 February 2003 β yeah, she's an elder but she still ate π₯ β¨π§π
π¦ where this page comes from
- debian bookworm: cpu 1.4.3-14~deb12u1 Β· GPL-2.0-or-later
- debian trixie: cpu 1.4.3-15+b1 Β· GPL-2.0-or-later
- ubuntu jammy: cpu 1.4.3-13build1 Β· GPL-2.0-or-later
- ubuntu noble: cpu 1.4.3-13build2 Β· GPL-2.0-or-later
- ubuntu questing: cpu 1.4.3-16
- ubuntu resolute: cpu 1.4.3-16build1 Β· GPL-2.0-or-later
- ubuntu stonking: cpu 1.4.3-16build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms