加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

saltstack添加一个Linux用户

发布时间:2020-12-14 01:52:25 所属栏目:Linux 来源:网络整理
导读:官网地址:https://docs.saltstack.com/en/latest/ref/states/all/salt.states.user.html 状态文件user.sls: useradd: group.present: - name: hthx - gid: 1000 user.present: - name: hthx - fullname: hthx - uid: 1000 - gid: 1000 - home: /home/ hthx

官网地址:https://docs.saltstack.com/en/latest/ref/states/all/salt.states.user.html

状态文件user.sls:

useradd:
  group.present:
    - name: hthx
    - gid: 1000

  user.present:
    - name: hthx
    - fullname: hthx
    - uid: 1000
    - gid: 1000
    - home: /home/hthx
    - shell: /bin/bash
    - groups:
      - hthx
    - unique: True
    - password: $1$gKBCvdRz$UiFWG4g5Nxk651jUpbNX0.
    - enforce_password: False

用户的密码是加密过后的密码,这里通过openssl加密:

[[email?protected] init]# openssl passwd -1
Password:
Verifying - Password:
$1$yZX/9PLG$qxmRn/vZ58ownUEWrOOnw.                #<==设置密码123456,生成后的字符串

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读