saltstack内置执行模块useradd
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的更多相关文章
- saltstack内置执行模块groupadd
groupadd模块用于命令行管理用户组 salt.modules.groupadd.add(name, gid=None, system=False) 添加一个用户到指定GID 例:salt '*' ...
- saltstack内置执行模块shadow
shadow用于命令行管理shadow文件 salt.modules.shadow.default_hash() 用户未设置密码的默认哈希 例:salt '*' shadow.default_hash ...
- saltstack内置state模块file之append
添加文件文本在文件尾部 salt.states.file.append(name, text=None, makedirs=False, source=None, source_hash=None, ...
- saltstack内置state模块user
user 模块是用来创建用户和管理用户设定的,用户可以被设置成 present 状态或者 absent 状态. hwg: user.present: - fullname: Jim - shell: ...
- saltstack内置state模块file之managed
managed管理一个模板文件,载入到各个节点并运行相应配置 salt.states.file.managed(name, source=None, source_hash='', user=None ...
- day05 模块以及内置常用模块用法
内置常用模块详解: 1 time 2 datetime 3 random 4 os 5 sys 6 shutil 7 shelve 8 xml 9 configparser 10 hashlib ...
- 【CobaltStrike】对CobaltStrike内置功能模块的了解
对CobaltStrike内置功能模块的了解 0x00 右键功能列表 Interact 打开beacon Access dump hashes 获取hash Elevate 提权 Golden Tic ...
- day25 内置常用模块(四): 模块和包
阅读目录: 模块 import from xxx import xxx 包 import from xxx import xxx from xxx import * __init__.p ...
- Python内置OS模块用法详解
大家好,从今天起早起Python将持续更新由小甜同学从初学者的角度学习Python的笔记,其特点就是全文大多由新手易理解的代码与注释及动态演示.刚入门的读者千万不要错过! 很多人学习python,不知 ...
随机推荐
- EXISTS语句的子查询
一.EXISTS运算符简介: 使用EXISTS语句可以测试集合是否为空,EXISTS语句通常与子查询结合在一起使用.只要子查询中至少返回一个值,则EXISTS语句的值就为True.EXISTS子查询的 ...
- 脑科学对基金经理的八个启示 z
脑科学对基金经理的八个启示 第一,总想要更多.人类大脑是在物资奇缺过程中进化的,所以获得任何“资源”,如食物.性.金钱等,都可以让人感觉良好,大脑也会鼓励我们继续下去. 事实上,可卡因等药物就是“绑架 ...
- python的序列化
参考:https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/0013868322157 ...
- AJAX enabled & disabled
@model string @{ ViewBag.Title = "GetPeople"; AjaxOptions ajaxOpts = new A ...
- JSON-JSON 百科
1,百度百科 http://baike.baidu.com/view/136475.htm?fr=aladdin 2,JSON教程 http://www.w3school.com.cn/json/
- ISP模块之色彩增强算法--HSV空间Saturation通道调整 .
色彩增强不同于彩色图像增强,图像增强的一般处理方式为直方图均衡化等,目的是为了增强图像局部以及整体对比度.而色彩增强的目的是为了使的原有的不饱和的色彩信息变得饱和.丰富起来.对应于Photoshop里 ...
- 一个例子理解Predicate、Consumer和Stream
一个需求: 把年龄大于20的学生的信息打印出来. 面向对象编程 public class Student { private String name; private int age; private ...
- EF使用延迟加载的本质原因
EF(Entity Framework)是微软的一个ORM框架 使用过EF的同学都知道它有一个延迟加载的功能 那么这个延迟加载的功能到底是什么? 为什么需要延迟加载? 使用延迟加载的优点和缺点又各是什 ...
- UnrealEngine4 尝鲜
把官方事例的demo扩展成横版过关视角
- .Net、C# 汉字转拼音,简体繁体转换方法
Visual Studio International Pack 包含一组类库,该类库扩展了.NET Framework对全球化软件开发的支持.使用该类库提供的类,.NET 开发人员可以更方便的创建支 ...