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. yaffs和jffs2简单比较

    转:http://blog.chinaunix.net/uid-27675161-id-3392636.html 相关知识引用<嵌入式 Linux 应用开发 完全手册>    Nand F ...

  2. openfire源码解读之将cache和session对象移入redis以提升性能

    原文:http://blog.csdn.net/jinzhencs/article/details/50522322 前言: 目前我们的openfire服务器只能支撑单机2W 集群4W.(估测在线用户 ...

  3. ora01940 无法删除当前连接的用户

    我用system这个用户登录oracle,想删除掉一个自己创建的用户user,在网上找到的方法都是说先查找到该用户连接的会话select username,sid,serial# from v$ses ...

  4. background属性总结,background-image路径问题相对于css和js

    (1)background属性总结 background 简写属性在一个声明中设置所有的背景属性. 可以设置如下属性:background-color规定要使用的背景颜色.background-pos ...

  5. Linux下系统信息工具之Saidar

    Saidar,是一款命令行下的小工具,可用来查看CPU.进程.负载.内存.交换分区.网络.磁盘.文件系统等系统信息. #ubuntu sudo apt-get install saidar -y #f ...

  6. Android Tabhost置于底部

    方法一: <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id=&qu ...

  7. iOS 通用button 上图下字

    UIButton *first = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kHeight(80), kHeight(80))]; [firs ...

  8. Android学习(十六) 通过GestureDetector进行手势识别

    一.手势交互过程: 1)触屏时,触发MotionEvent事件. 2)被OnTouchListener监听,在onTouch()中获得MotionEvent对象. 3)GestureDetector转 ...

  9. Android学习(十) SQLite 基于内置函数的操作方式

    main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns ...

  10. 用SwiftGen管理UIImage等的String-based接口

    代码地址如下:http://www.demodashi.com/demo/12149.html 问题现状 平时我们使用UIImage,UIFont,UIColor会遇到很多String-based的接 ...