salt.modules.pw_user
Manage users with the useradd command
Members
add
-
salt.modules.pw_user.add(name, uid=None, gid=None, groups=None, home=True, shell=None, system=False, **kwargs)
Add a user to the minion
CLI Example:
salt '*' user.add name <uid> <gid> <groups> <home> <shell>
chgid
-
salt.modules.pw_user.chgid(name, gid)
Change the default group of the user
CLI Example:
salt '*' user.chgid foo 4376
chgroups
-
salt.modules.pw_user.chgroups(name, groups, append=False)
Change the groups this user belongs to, add append to append the specified
groups
CLI Example:
salt '*' user.chgroups foo wheel,root True
chhome
-
salt.modules.pw_user.chhome(name, home, persist=False)
Change the home directory of the user, pass true for persist to copy files
to the new home dir
CLI Example:
salt '*' user.chhome foo /home/users/foo True
chshell
-
salt.modules.pw_user.chshell(name, shell)
Change the default shell of the user
CLI Example:
salt '*' user.chshell foo /bin/zsh
chuid
-
salt.modules.pw_user.chuid(name, uid)
Change the uid for a named user
CLI Example:
salt '*' user.chuid foo 4376
delete
-
salt.modules.pw_user.delete(name, remove=False, force=False)
Remove a user from the minion
CLI Example:
salt '*' user.delete name True True
getent
-
salt.modules.pw_user.getent()
Return the list of all info for all users
CLI Example:
info
-
salt.modules.pw_user.info(name)
Return user information
CLI Example:
list_groups
-
salt.modules.pw_user.list_groups(name)
Return a list of groups the named user belongs to
CLI Example:
salt '*' user.list_groups foo