创建多个用户,创建的用户和密码键值对用上文章《 rex 加密Rexfile中账号和证书信息》生成hash字符串
每个账号一个,然后就可以。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
task "butchuser", group => "all", sub { my @ustr=qw(dGVzdDo6dGVzdA== dGVzdDo6deVzdA== dGVzdDo6dGVeA==); for (@ustr) { my $str=$_; my $dst = decode_base64($str); my ( $userId, $pass)= split /::/,$dst; create_user $userId, password => $pass, home => '/home/'.$userId; append_if_no_such_line "/etc/sudoers", "$userId ALL=(ALL) ALL"; } say connection->server; }; |