Manage users with the useradd command
Add a user to the minion
CLI Example:
salt '*' user.add name <uid> <gid> <groups> <home> <shell>
Change the user's Full Name
CLI Example:
salt '*' user.chfullname foo "Foo Bar"
Change the default group of the user
CLI Example:
salt '*' user.chgid foo 4376
Change the groups this user belongs to, add append to append the specified groups
CLI Example:
salt '*' user.chgroups foo wheel,root True
Change the home directory of the user, pass True for persist to move files to the new home directory if the old home directory exist.
CLI Example:
salt '*' user.chhome foo /home/users/foo True
Change the user's Home Phone
CLI Example:
salt '*' user.chhomephone foo "7735551234"
Change the default login class of the user
CLI Example:
salt '*' user.chloginclass foo staff
Change the user's Room Number
CLI Example:
salt '*' user.chroomnumber foo 123
Change the default shell of the user
CLI Example:
salt '*' user.chshell foo /bin/zsh
Change the uid for a named user
CLI Example:
salt '*' user.chuid foo 4376
Change the user's Work Phone
CLI Example:
salt '*' user.chworkphone foo "7735550123"
Remove a user from the minion
CLI Example:
salt '*' user.delete name remove=True force=True
Get the login class of the user
CLI Example:
salt '*' user.get_loginclass foo
Return the list of all info for all users
CLI Example:
salt '*' user.getent
Return user information
CLI Example:
salt '*' user.info root
Return a list of groups the named user belongs to
CLI Example:
salt '*' user.list_groups foo
Return a list of all users
CLI Example:
salt '*' user.list_users
Change the username for a named user
CLI Example:
salt '*' user.rename name new_name
Docs for previous releases are available on readthedocs.org.
Latest Salt release: 2015.5.1