useradd模块用于命令行管理用户

salt.modules.useradd.add(name, uid=None, gid=None, groups=None, home=None, shell=None, unique=True, system=False, fullname='', roomnumber='', workphone='', homephone='', createhome=True, loginclass=None)

添加用户到节点

例:salt '*' user.add name <uid> <gid> <groups> <home> <shell>

salt.modules.useradd.chfullname(name, fullname)

改变用户全名

例:salt '*' user.chfullname hwg "Jim"

salt.modules.useradd.chgid(name, gid)

更改用户UID

例:salt '*' user.chgid hwg 701

salt.modules.useradd.chgroups(name, groups, append=False)

改变用户属组,追加指定用户组

例:salt '*' user.chgroups hwg wheel,root True

salt.modules.useradd.chhome(name, home, persist=False)

更改用户家目录,persist设为True,拷贝原家目录到新家目录

例:salt '*' user.chhome hwg /home/users/hwg True

salt.modules.useradd.chshell(name, shell)

更改用户shell

例:salt '*' user.chshell hwg /bin/bash

salt.modules.useradd.chuid(name, uid)

更改用户UID

例:salt '*' user.chuid hwg 702

salt.modules.useradd.delete(name, remove=False, force=False)
从节点删除用户
例:salt '*' user.delete name remove=True force=True
salt.modules.useradd.getent(refresh=False)
返回所有用户信息
例:salt '*' user.getent
salt.modules.useradd.info(name)
返回指定用户信息
例:salt '*' user.info root
salt.modules.useradd.list_groups(name)
返回用户属组
例:salt '*' user.list_groups hwg
salt.modules.useradd.list_users()
返回用户列表
例:salt '*' user.list_users
salt.modules.useradd.rename(name, new_name)
更改用户名
例:salt '*' user.rename name new_name

saltstack内置执行模块useradd的更多相关文章

  1. saltstack内置执行模块groupadd

    groupadd模块用于命令行管理用户组 salt.modules.groupadd.add(name, gid=None, system=False) 添加一个用户到指定GID 例:salt '*' ...

  2. saltstack内置执行模块shadow

    shadow用于命令行管理shadow文件 salt.modules.shadow.default_hash() 用户未设置密码的默认哈希 例:salt '*' shadow.default_hash ...

  3. saltstack内置state模块file之append

    添加文件文本在文件尾部 salt.states.file.append(name, text=None, makedirs=False, source=None, source_hash=None, ...

  4. saltstack内置state模块user

    user 模块是用来创建用户和管理用户设定的,用户可以被设置成 present 状态或者 absent 状态. hwg: user.present: - fullname: Jim - shell: ...

  5. saltstack内置state模块file之managed

    managed管理一个模板文件,载入到各个节点并运行相应配置 salt.states.file.managed(name, source=None, source_hash='', user=None ...

  6. day05 模块以及内置常用模块用法

    内置常用模块详解: 1 time 2 datetime 3 random   4 os 5 sys 6 shutil 7 shelve 8 xml 9 configparser 10 hashlib ...

  7. 【CobaltStrike】对CobaltStrike内置功能模块的了解

    对CobaltStrike内置功能模块的了解 0x00 右键功能列表 Interact 打开beacon Access dump hashes 获取hash Elevate 提权 Golden Tic ...

  8. day25 内置常用模块(四): 模块和包

    阅读目录: 模块 import from xxx import xxx 包 import from xxx import xxx    from xxx  import *    __init__.p ...

  9. Python内置OS模块用法详解

    大家好,从今天起早起Python将持续更新由小甜同学从初学者的角度学习Python的笔记,其特点就是全文大多由新手易理解的代码与注释及动态演示.刚入门的读者千万不要错过! 很多人学习python,不知 ...

随机推荐

  1. EXISTS语句的子查询

    一.EXISTS运算符简介: 使用EXISTS语句可以测试集合是否为空,EXISTS语句通常与子查询结合在一起使用.只要子查询中至少返回一个值,则EXISTS语句的值就为True.EXISTS子查询的 ...

  2. DEV MarqueeProgressBarControl控件

    原文地址:http://www.dobug.net/showtopic-672.html MarqueeProgressBarControl是DevExpress的一个进度条控件,该控件和Progre ...

  3. 愤怒的TryCatch

    本文地址:http://www.cnblogs.com/likeli/p/5719230.html 前言 本文不提供任何搭梯子之类的内容,我在这里仅仅讨论网络爬虫遇到的IP封杀,然后使用Tor如何对抗 ...

  4. select 下拉框的选中项的change事件

    HTML文件 <span style="float: left;">类      型:   <select id="type" class=& ...

  5. 设计模式之工厂模式之简单工厂(php实现)

    github源码地址: git@github.com:ZQCard/design_pattern.git 1.简单工厂模式 特点:将调用者与创建者分离,调用者直接向工厂请求,减少代码的耦合.提高系统的 ...

  6. win10安装nodejs

    https://jingyan.baidu.com/article/b0b63dbfca599a4a483070a5.html 1 去官网下载对应版本的msi文件 2安装,path会自动设置 3 检验 ...

  7. Unity定制 Image、Text的对象生成

    2016.4.14 昨天看到 雨凇的 Unity3D研究院之UGUI一个优化效率小技巧:  http://www.xuanyusong.com/archives/4006 完好了他所说的代码: usi ...

  8. 2017.5.9 java多线程总结

    参考来自:http://www.cnblogs.com/lwbqqyumidi/p/3804883.html http://blog.csdn.net/gf771115/article/details ...

  9. setContentView

    setContentView(R.layout.main)在Android里面,这句话是什么意思? R.layout.main是个布局文件即控件都是如何摆放如何显示的,setContentView就是 ...

  10. 函数传参,改变Div任意属性的值&&图片列表:鼠标移入/移出改变图片透明度

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...