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. 鼠标悬浮tip 显示

    鼠标悬浮tip 显示 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> &l ...

  2. FIREDAC驱动MYSQL数据库

    FIREDAC驱动MYSQL数据库 FIREDAC连接MYSQL数据库需要用到LIBMYSQL.DLL这个动态库. 这个LIBMYSQL.DLL分为32位和64位两个不同的版本,对应32位或64位的M ...

  3. Android基于代理的插件化思路分析

    前言 正常的App开发流程基本上是这样的:开发功能-->测试--->上线,上线后发现有大bug,紧急修复---->发新版本---->用户更新----->bug修复.从发现 ...

  4. ASP.NET 5基础之中间件

    来源https://docs.asp.net/en/latest/fundamentals/middleware.html 一些可以整合进http请求管道的小的应用组件称做中间件.ASP.NET 5集 ...

  5. python 中的 sorted

    1) 输入help(sorted)可以得到下面类容: ------------------------------------------------------------------------- ...

  6. appium Parameters were incorrect

    raise exception_class(value) selenium.common.exceptions.WebDriverException: Message: Parameters were ...

  7. WEB服务器、应用程序服务器、HTTP服务器区别 【转】

    WEB服务器.应用程序服务器.HTTP服务器有何区别?IIS.Apache.Tomcat.Weblogic.WebSphere都各属于哪种服务器,这些问题困惑了很久,今天终于梳理清楚了: Web服务器 ...

  8. adb 设备不识别

    android真坑 有两台测试机 都能连能snapdragon profiling了 忽然 一台不能识别了 adb devices 就不存在 一台一直是好的 kill server start ser ...

  9. Snapdragon profiler连不上 android手机

    adb devices也是空 开发者选项里面该开的都开了 就可以了 对了数据线不对也会连不上...

  10. Java Enum的多态性

    转载自:http://pf-miles.iteye.com/blog/187155 Enum+多态,我没说错,不过Enum是不可以被继承的,也不可以继承自别人,只是能实现接口而已,何谈多态?不过还是先 ...