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, --gecos gecos β€” The new value of the user's comment field (gecos). 🫢 (Bestie, do not use this to modify displayName or cn. Use the -N and -S options combined instead β€” that's the correct way, iykyk.)
  • -d, --homedir home_dir β€” The user's new login directory. Moving day! πŸ“¦
  • -r, --rename new_user β€” Lets you rename a user. This option will update the dn attribute for the user. You can also update other attributes using the corresponding script options. ✨
  • -u, --uid uid β€” The numerical value of the user's ID. This value must be unique, unless the -o option 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 β€” uidNumber can be non unique. (Chaos option, but consenting chaos. πŸ™ˆ)
  • -g, --gid initial_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 is 1.
  • -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 -g option. 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, --shel shell β€” 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 (attribute givenName). Additionally used to set the first name in displayName and cn. πŸ’«
  • -S, --surname β€” Set the user's surname (attribute sn). Additionally used to set the last name in displayName and cn. πŸ’«
  • -P β€” End by invoking smbldap-passwd to change the user password (both unix and samba passwords). πŸŽ€
  • -M, --mailAddresses mail,[...] β€” mailAddresses (comma separated).
  • -T, --mailToAddress mail,[...] β€” 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 either YYYY-MM-DD or '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 from Junary 1 1970 to 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 the sambaSAMAccount objectclass 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. 🐦🐦
  • --ou node β€” 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 of shadowExpire is also supported. This option uses the internal 'timelocal' command to set calculate the number of seconds from Junary 1 1970 to the specified date. πŸ—“οΈ
  • -A, --sambaPwdCanChange β€” can change password ? 0 if no, 1 if yes.
  • -B, --sambaPwdMustChange β€” must change password ? 0 if no, 1 if yes.
  • -C, --sambaHomePath path β€” sambaHomePath (SMB home share, like '\\\\PDC-SRV\\homes').
  • -D, --sambaHomeDrive drive β€” sambaHomeDrive (letter associated with home share, like 'H:').
  • -E, --sambaLogonScript script β€” sambaLogonScript, relative to the [netlogon] share (DOS script to execute on login, like 'foo.bat').
  • -F, --sambaProfilePath path β€” sambaProfilePath (profile directory, like '\\\\PDC-SRV\\profiles\\foo').
  • -H, --sambaAcctFlags flags β€” sambaAcctFlags, spaces and trailing bracket are ignored (samba account control bits like '[NDHTUMWSLKI]').
  • -I, --sambaDisable β€” disable user. Can't be used with -H or -J. 🚫
  • -J, --sambaEnable β€” enable user. Can't be used with -H or -I. 🚫
  • -h, --help β€” print this help. 🫢
Ok real talk: -I and -J are 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