SMBLDAP...RMOD.CMD(8)
π NAME π
smbldap-usermod β bestie, this is literally the glow-up command for a user account. It Modifys a user account. That's it. That's the whole vibe. β¨
(Also hi, yes, the man page file itself is called SMBLDAP...RMOD.CMD(8) and it lives in the User Contributed Perl Documentation section, so if you're squinting at the header going "why is it truncated like that" β it's always been like that, it's iconic, we don't ask. π)
π¦ SYNOPSIS π¦
smbldap-usermod [-c gecos] [-d home_dir] [-r login_name] [-u uid] [-g
gid] [-o] [-G group[,...]] [-s shell] [-N first_name] [-S surname] [-P]
[-M mail[,...]] [-T mail,[..]] [--shadowExpire date/n] [--shadowMax n]
[--shadowMin n] [--shadowInactive n] [--shadowWarning n] [-L] [-U] [-a]
[-e expiration_date/n] [--sambaExpire date/n] [-A canchange] [-B
mustchange] [-C smbhome] [-D homedrive] [-E scriptpath] [-F profilepath]
[-H acctflags] [-I] [-J] [-h] login
Look at all those little flags. It's giving "swiss army knife but make it LDAP." And yeah, you always gotta end with login β that's the user you're editing, the main character of this operation. π
πΈ DESCRIPTION πΈ
The smbldap-usermod command modifies the system account files to reflect the changes that are specified on the command line.
Translation: you tell it what to change, it goes and changes it. No drama, no ceremony, just vibes and attribute updates. π
π UNIX options π
These ones are all about the classic Unix side of the house. π
-c,--gecosgecos β The new value of the user's comment field (gecos). π«Ά (Bestie, do not use this to modifydisplayNameorcn. Use the-Nand-Soptions combined instead β that's the correct way, iykyk.)-d,--homedirhome_dir β The user's new login directory. Moving day! π¦-r,--renamenew_user β Lets you rename a user. This option will update thednattribute for the user. You can also update other attributes using the corresponding script options. β¨-u,--uiduid β The numerical value of the user's ID. This value must be unique, unless the-ooption is used. The value must be non negative. Any files which the user owns and which are located in the directory tree rooted at the user's home directory will have the file user ID changed automatically. Files outside of the user's home directory must be altered manually β so like, that's on you, not on the script. π-o,--canBeNotUniqueβuidNumbercan be non unique. (Chaos option, but consenting chaos. π)-g,--gidinitial_group β The group name or number of the user's new initial login group. The group name must exist. A group number must refer to an already existing group. The default group number is1.-G,--group[+-]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. The groups are subject to the same restrictions as the group given with the-goption. If the user is currently a member of a group which is not listed, the user will be removed from the group β unless the'+'or'-'character is used to add or remove groups to the initial ones. β οΈ-s,--shelshell β The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell. π (Yes, the long option is spelled--shel. We don't fix it. It's part of the lore.)-N,--givenNameβ set the user's given name (attributegivenName). Additionally used to set the first name indisplayNameandcn. π«-S,--surnameβ Set the user's surname (attributesn). Additionally used to set the last name indisplayNameandcn. π«-Pβ End by invokingsmbldap-passwdto change the user password (both unix and samba passwords). π-M,--mailAddressesmail,[...] βmailAddresses(comma separated).-T,--mailToAddressmail,[...] βmailToAddress(forward address) (comma separated).--shadowExpire <YYYY-MM-DD/n>β Set the expiration date for the user password. This only affects the unix account. The date may be specified as eitherYYYY-MM-DDor'n'days from day. The'n'syntax also supports the extended format(#y)(#m)(#d)for years, months, and days from today. You need not specify all three, so all of the following are examples of valid input:'5y4m2d'(5 years, 4 months, and 2 days),'5y'(5 years),'5y2d'(5 years and 2 days), and'3'(3 days). This option calls the internal'timelocal'command to set calculate the number of seconds fromJunary 1 1970to the specified date. ποΈ--shadowMax <n>β User must change the password, at least, every'n'days.--shadowMin <n>β User must wait'n'days once the password has changed before changing it again. (Patience, bestie. β³)--shadowInactive <n>β Number of days of inactivity allowed for the specified user.--shadowWarning <n>β User is warned that the password must be changed four days before the password expires.-L,--shadowLockβ Lock unix user's password. This puts a'!'in front of the encrypted password, effectively disabling the password. π-U,--shadowUnlockβ Unlock unix user's password. This removes the'!'in front of the encrypted password. π
π SAMBA options π
Now for the Samba half of the personality. π¦
-a,--addsambaSAMAccountβ Add thesambaSAMAccountobjectclass to the specified user account. This allows the user to become a samba user. β¨-e,--expire<YYYY-MM-DD(HH:MM:SS)/n> β Sets the expiration for both samba (--sambaExpire) and shadow (--shadowExpire). Two birds, one flag. π¦π¦--ounode β The user's account will be moved to the specified organazional unit. It is relative to the user suffix dn ($usersdn) defined in the configuration file. Ex:'ou=admin,ou=all'--sambaExpire <YYYY-MM-DD HH:MM:SS/n>β Set the expiration date for the user account. This only affects the samba account. The date must be in the following format:YYYY-MM-DD HH:MM:SS. The n-days format ofshadowExpireis also supported. This option uses the internal'timelocal'command to set calculate the number of seconds fromJunary 1 1970to the specified date. ποΈ-A,--sambaPwdCanChangeβ can change password ?0if no,1if yes.-B,--sambaPwdMustChangeβ must change password ?0if no,1if yes.-C,--sambaHomePathpath βsambaHomePath(SMB home share, like'\\\\PDC-SRV\\homes').-D,--sambaHomeDrivedrive βsambaHomeDrive(letter associated with home share, like'H:').-E,--sambaLogonScriptscript βsambaLogonScript, relative to the[netlogon]share (DOS script to execute on login, like'foo.bat').-F,--sambaProfilePathpath βsambaProfilePath(profile directory, like'\\\\PDC-SRV\\profiles\\foo').-H,--sambaAcctFlagsflags βsambaAcctFlags, spaces and trailing bracket are ignored (samba account control bits like'[NDHTUMWSLKI]').-I,--sambaDisableβ disable user. Can't be used with-Hor-J. π«-J,--sambaEnableβ enable user. Can't be used with-Hor-I. π«-h,--helpβ print this help. π«Ά
Ok real talk:-Iand-Jare mutually exclusive with each other AND with-H. Pick a lane, bestie. The script will absolutely not hold your hand through that one. π
π SEE ALSO π
usermod(1)
And that's the whole page, no notes. This little gem is from perl v5.32.1, dated 2021-11-07, so go forth and modify those accounts responsibly, bestie. Mwah. π
π¦ where this page comes from
- ubuntu jammy: smbldap-tools 0.9.11-3ubuntu1 Β· GPL-2.0-or-later
- ubuntu noble: smbldap-tools 0.9.11-3ubuntu1 Β· 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