首页 > 系统服务 > 详细

批量添加 linux用户(备忘)

时间:2017-02-06 10:42:41      阅读:206      评论:0      收藏:0      [点我收藏+]

1、编辑文件batchAddUsers.txt

cd ~
vim batchAddUsers.txt

 

batchAddUsers.txt:
userName1:passwd1:userId1:groupId1:description1:/bin/bash
userName2:passwd2:userId2:groupId2:description2:/bin/bash

 

2、通过newusers命令来导入用户

/usr/sbin/newusers ~/batchAddUsers.txt

 

* 需要有超级用权限

 

 

需要修改密码的情况:

1、关闭密码加密功能

/usr/sbin/pwunconv

2、编辑batchChangePw.txt

vim ~/batchChangePw.txt
batchChangePw.txt:
user_test1:passwd1
user_test1:passwd2

3、导入修改密码

chpasswd ~/batchChangePw.txt

4、开启密码加密

/usr/sbin/pwconv

 

批量添加 linux用户(备忘)

原文:http://www.cnblogs.com/gabin/p/6369247.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!