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. 【启动】Windows上启动图形化软件,报错: 无法启动此程序,因为计算机中丢失api-ms-win-crt-runtime-1-1-0.dll

    今天在安装了jetbrains官网上的ToolBox软件后,没有办法启动起来,报错如下: 无法启动此程序,因为计算机中丢失api-ms-win-crt-runtime-1-1-0.dll 尝试重新安装 ...

  2. cordova百度导航插件使用

    org.ssgroup.sope.cordova.baiduNavi 插件已经开源至 https://github.com/shenshouer/org.ssgroup.sope.cordova.ba ...

  3. linux 下查看硬件信息(mac,IP地址,硬盘型号,序列号等)

    一.查看网卡mac地址 #安装lshw [root@server ~]# yum install lshw #使用方法 [root@rsync-server ~]# lshw -c network * ...

  4. ElasticSearch中设置排序Java

    有用的链接:http://stackoverflow.com/questions/12215380/sorting-on-several-fields-in-elasticsearch 有的时候,需要 ...

  5. How to Clear setInterval() without Knowing the ID

    ProblemDeclaring a setInterval() without keeping a reference to it (which is returned from the funct ...

  6. 2017.3.31 spring mvc教程(一)核心类与接口

    学习的博客:http://elf8848.iteye.com/blog/875830/ 我项目中所用的版本:4.2.0.博客的时间比较早,11年的,学习的是Spring3 MVC.不知道版本上有没有变 ...

  7. HDU 5308 规律+模拟

    给出N个数字N,要把全部数字用完.使用+-*/最后变为24.中间运算能够有有浮点数 对于1-14直接打表 15以上的能够通过13个同样数字得到24.然后使后面的数所有运算为0相加就可以 贴一发官方题解 ...

  8. 单点登录cas常见问题(四) - ticket有哪些存储方式?

    配置文件ticketRegistry.xml负责配置ticket的存储方式,registry是注冊表,登记薄的意思 经常使用的存储方式包含 1.DefaultTicketRegistry:默认的.存储 ...

  9. quick-cocos2d-x教程9:实例之加上背景图片

    在梳理完quick-cocos2d-x框架的各个文件夹后,我们開始我们的实例教程,在helloworld后面.加上一张图片,lua编辑器,我用的lua editor.还不错. 我们首先还是參照教程.创 ...

  10. RabbitMQ一

    RabbitMQ: 一.rabbitmq的系统架构: RabbitMQ Server:也叫broker server,它不是运送食物的卡车,而是一种传输服务.原话是RabbitMQisn’t a fo ...