码迷,mamicode.com
首页 > 其他好文 > 详细

6-puppet用户管理

时间:2016-04-13 20:56:17      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:puppet

一、用户管理

生成用户秘钥:

 grub-crypt --sha-512

Password:

Retype password:

$6$lYIpu8h4TH7Nf0RM$3lUprHO3gy4XqmCwf0EMqyZjJz1alnISVEk0D/VV9pR3jVBhrzk/vysBRWaTfAZjiuYmc/OrPas8Hs8torqm91

普通创建

vim /etc/puppet/manifests/site.pp

user { ‘longge‘:

    ensure     => present,

    home       => ‘/home/longge‘,

    managehome => true,

    password   => ‘$6$lYIpu8h4TH7Nf0RM$3lUprHO3gy4XqmCwf0EMqyZjJz1alnISVEk0D/VV9pR3jVBhrzk/vysBRWaTfAZjiuYmc/OrPas8Hs8torqm91‘,

}

指定UID 制定GID指定组

group { ‘longge‘:

    ensure => present,

    gid    => 1000,

}

user { ‘longge‘:

    ensure     => present,

    home       => ‘/home/longge‘,

    managehome => true,

    uid        => 1000,

    gid        => 1000,

    groups     => [‘longge‘, ‘wheel‘],

    password   => ‘$6$lYIpu8h4TH7Nf0RM$3lUprHO3gy4XqmCwf0EMqyZjJz1alnISVEk0D/VV9pR3jVBhrzk/vysBRWaTfAZjiuYmc/OrPas8Hs8torqm91‘,

}

删除用户

user { ‘longge‘:

        ensure => absent,

        home   => ‘/home/longge‘,

        managehome => true,

}

二、用户组管理

创建一个组

vim /etc/puppet/manifests/site.pp

group { ‘longge‘: ensure => present }

创建一个组,指定GID

vi /etc/puppet/manifests/site.pp

group { ‘longge‘:

    ensure => present,

    gid    => 1000,

}

删除一个组

vim /etc/puppet/manifests/site.pp

group { ‘longge‘: ensure => absent }

 


本文出自 “IT漫漫路” 博客,请务必保留此出处http://longgege.blog.51cto.com/6740519/1763501

6-puppet用户管理

标签:puppet

原文地址:http://longgege.blog.51cto.com/6740519/1763501

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!