1、group.add模块
group.add:添加指定用户组。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ group.add user1 1000 salt-minion02.contoso.com: True
2、group.info模块
group.info:返回用户组信息。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ group.info user1 salt-minion02.contoso.com: ---------- gid: 1000 members: name: user1 passwd: x
3、group.getent模块
group.getent:返回所有用户组的信息。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ group.getent salt-minion02.contoso.com: |_ ---------- gid: 0 members: name: root passwd: x |_ ---------- gid: 1 members: - bin - daemon name: bin passwd: x |_ ---------- gid: 2 members: - bin - daemon name: daemon passwd: x |_ ---------- gid: 3 members: - bin - adm name: sys passwd: x |_ ---------- gid: 4 members: - adm - daemon name: adm passwd: x |_ ---------- gid: 5 members: name: tty passwd: x |_ ---------- gid: 6 members: name: disk passwd: x |_ ---------- gid: 7 members: - daemon name: lp passwd: x |_ .......
4、group.adduser模块
group.adduser:添加一个用户到指定组中。(必须是一个已经存在的组和已存在的用户)
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ group.adduser user1 zabbix salt-minion02.contoso.com: True
5、group.deluser模块
group.deluser:将用户从用户组中移除。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ group.deluser user1 zabbix salt-minion02.contoso.com: True
6、group.delete模块
group.delete:移除指定用户组。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ group.delete user1 salt-minion02.contoso.com: True
7、user.add模块
user.add:在minion端上创建一个用户。用法:salt ‘*‘ user.add name <uid> <gid> <groups> <home> <shell>。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ user.add test 610 605 zabbix /home/test /bin/bash salt-minion02.contoso.com: True
8、user.info模块
user.info:返回用户信息。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ user.info test salt-minion02.contoso.com: ---------- fullname: gid: 605 groups: - zabbix home: /home/test homephone: name: test passwd: x roomnumber: shell: /bin/bash uid: 610 workphone:
9、user.getent模块
user.getent:返回所有系统用户信息的列表。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ user.getent salt-minion02.contoso.com: |_ ---------- fullname: root gid: 0 groups: - root home: /root homephone: name: root passwd: x roomnumber: shell: /bin/bash uid: 0 workphone: |_ ---------- fullname: bin gid: 1 groups: - bin - daemon - sys home: /bin homephone: name: bin passwd: x roomnumber: shell: /sbin/nologin uid: 1 workphone: .......
10、user.list_groups模块
user.list_groups:列出指定用户所属组的列表。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ user.list_groups zabbix salt-minion02.contoso.com: - zabbix
11、user.rename模块
user.rename:修改指定用户的用户名。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ user.rename test testuser salt-minion02.contoso.com: False
(虽然返回False但是操作是成功完成了的)
12、user.delete模块
user.delete:在minion端删除一个用户。
[[email protected] ~]# salt ‘salt-minion02.contoso.com‘ user.delete test salt-minion02.contoso.com: True
时间: 2024-10-11 17:15:50