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,不知 ...
随机推荐
- WPF中的DesignMode判断
WPF中提供你一个类似WinForm的DesignMode属性的方法来判断当前是否处于设计器模式: bool IsInDesignMode { get { return Desig ...
- javascript 对象属性的添加,删除,json对象和字符串转换方法等
1:动态添加 对象属性 var obj = new Object(); console.log (obj.username); obj.username = "haha"; con ...
- sqlserver中常用的四个选项(NOCOUNT/ANSI_NULLS/QUOTED_IDENTIFIER/ XACT_ABORT)
1 NOCOUNT选项 当 SET NOCOUNT 为 ON 时,不返回计数.当 SET NOCOUNT 为 OFF 时,返回计数. eg: if object_id(N'table_test',N' ...
- ubuntu 16.04 网络配置之虚拟网卡的配置
关于图形界面的配置,我这里就不多介绍了,这个很简单.这里介绍的是如何通过修改配置文件来实现虚拟网卡. 首先介绍ubuntu(我这里使用的是ubuntu-16.04)下虚拟网卡的配置 1.先用ifcon ...
- 损失函数(loss function)
通常而言,损失函数由损失项(loss term)和正则项(regularization term)组成.发现一份不错的介绍资料: http://www.ics.uci.edu/~dramanan/te ...
- pip install 报错UnicodeDecodeError: 'ascii' codec can't decode byte
2017-03-23 报错原因: pip安装Python包会加载我的用户目录,我的用户目录恰好是中文的,ascii不能编码. 解决办法: python目录 Python27\Lib\site-pack ...
- 系统重装 Windows_VHD_辅助处理工具说明文档1
菜鸟也玩 VHD Windows VHD 辅助处理工具是一个用于创建.安装.维护 VHD 的辅助工具,把一个比较复杂的操作过程傻瓜化,使您轻松体验 VHD 的强大功能.您需要预备的就是一个准备装入 V ...
- 第14章5节《MonkeyRunner源代码剖析》 HierarchyViewer实现原理-装备ViewServer-查询ViewServer执行状态
上一小节我们描写叙述了HierarchyViewer是怎样组建ADB协议命令来实现ViewServer的port转发的.在port转发设置好后,下一个要做的事情就是去检測目标设备端ViewServer ...
- 【VBA】获取模板保存的路径
使用VBA如何获取模板保存的路径呢?具体代码如下: Sub 获取Excle模板保存路径() MsgBox "获取Excle模板保存路径:" & Application.Te ...
- 【VBA】VBA编写的,将一列中相同的内容的行提取出来单独生成文件
数据如上图所示,点击RUN后的运行结果如下: 得到该文件夹,文件夹内容如上图. 代码如下: Private Sub Command_OLIVER() Dim arr arr = Range(" ...