linux redhat shell 脚本 批量添加用户

[复制链接]
查看11 | 回复2 | 2012-9-27 23:55:06 | 显示全部楼层 |阅读模式
#!/bin/shi=0while truedolet i=i+1echo "u"$i":123456" >>/root/user.txtecho"createing useru$i................."useraddu$iif [ $i -eq 100 ]then
/usr/sbin/chpasswd/root/user.txt
/bin/rm -f /root/user.txt
exitfidone#if you want to delete all of the user,you can#i=0#wh...
回复

使用道具 举报

千问 | 2012-9-27 23:55:06 | 显示全部楼层
脚本批量创建用户mkdir /home/nisuservim /useradd.sh#!/bin/bash#for u in {1001..1100}doUSER=user$uuseradd -d /home/nisuser/$USER -u $u $USERecho "passwd$u" | passwd --stdin $USERdo...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行