Manage users with the useradd command
salt.modules.solaris_user.
add
(name, uid=None, gid=None, groups=None, home=None, shell=None, unique=True, fullname='', roomnumber='', workphone='', homephone='', createhome=True, **kwargs)¶Add a user to the minion
CLI 范例:
salt '*' user.add name <uid> <gid> <groups> <home> <shell>
salt.modules.solaris_user.
chfullname
(name, fullname)¶Change the user's Full Name
CLI 范例:
salt '*' user.chfullname foo "Foo Bar"
salt.modules.solaris_user.
chgid
(name, gid)¶Change the default group of the user
CLI 范例:
salt '*' user.chgid foo 4376
salt.modules.solaris_user.
chgroups
(name, groups, append=False)¶Change the groups to which a user belongs
True
to append these groups to the user's existing list of
groups. Otherwise, the specified groups will replace any existing
groups for the user.CLI 范例:
salt '*' user.chgroups foo wheel,root True
salt.modules.solaris_user.
chhome
(name, home, persist=False)¶Set a new home directory for an existing user
True
to prevent configuration files in the new home
directory from being overwritten by the files from the skeleton
directory.CLI 范例:
salt '*' user.chhome foo /home/users/foo True
salt.modules.solaris_user.
chhomephone
(name, homephone)¶Change the user's Home Phone
CLI 范例:
salt '*' user.chhomephone foo "7735551234"
salt.modules.solaris_user.
chroomnumber
(name, roomnumber)¶Change the user's Room Number
CLI 范例:
salt '*' user.chroomnumber foo 123
salt.modules.solaris_user.
chshell
(name, shell)¶Change the default shell of the user
CLI 范例:
salt '*' user.chshell foo /bin/zsh
salt.modules.solaris_user.
chuid
(name, uid)¶Change the uid for a named user
CLI 范例:
salt '*' user.chuid foo 4376
salt.modules.solaris_user.
chworkphone
(name, workphone)¶Change the user's Work Phone
CLI 范例:
salt '*' user.chworkphone foo "7735550123"
salt.modules.solaris_user.
delete
(name, remove=False, force=False)¶Remove a user from the minion
CLI 范例:
salt '*' user.delete name remove=True force=True
salt.modules.solaris_user.
getent
(refresh=False)¶Return the list of all info for all users
CLI 范例:
salt '*' user.getent
salt.modules.solaris_user.
info
(name)¶Return user information
CLI 范例:
salt '*' user.info root
salt.modules.solaris_user.
list_groups
(name)¶Return a list of groups the named user belongs to
CLI 范例:
salt '*' user.list_groups foo
salt.modules.solaris_user.
rename
(name, new_name)¶Change the username for a named user
CLI 范例:
salt '*' user.rename name new_name