批量添加用户

<!--[if gte mso 9]><![endif]-->

Newusers命令导入用户信息文件

格式:

[username]:[userpassword]:[UID]:[GID]:[usernote]:[userhome]:[shell]

首先用vi创建user.info文件

     可以在其写入

brother01::1001:3::/home/brother01:/bin/bash

brother02::1002:3::/home/brother02:/bin/bash

brother03::1003:3::/home/brother03:/bin/bash

brother04::1004:3::/home/brother04:/bin/bash

brother05::1005:3::/home/brother05:/bin/bash

brother06::1006:3::/home/brother06:/bin/bash

brother07::1007:3::/home/brother07:/bin/bash

brother08::1008:3::/home/brother08:/bin/bash

将其导入

[root@localhost home]# newusers <file1

则自动生成用户

可查看其文件

[root@localhost home]# tail -5 /etc/passwd

显示效果为

brother04:$1$fMPNXx5T$ILrPNrOxoEfqw4sQH7ozN/:1004:3::/home/brother04:/bin/bash

brother05:$1$fMPNXx5T$ILrPNrOxoEfqw4sQH7ozN/:1005:3::/home/brother05:/bin/bash

brother06:$1$fMPNXx5T$ILrPNrOxoEfqw4sQH7ozN/:1006:3::/home/brother06:/bin/bash

brother07:$1$fMPNXx5T$ILrPNrOxoEfqw4sQH7ozN/:1007:3::/home/brother07:/bin/bash

brother08:$1$fMPNXx5T$ILrPNrOxoEfqw4sQH7ozN/:1008:3::/home/brother08:/bin/bash

/home中可以看到将为其文件自动生成

[root@localhost home]# ls 

显示效果为

brother01  brother04  brother07  dir_2  file4  home      user.info  

brother02  brother05  brother08  dir4   file5  new_list  brother03  brother06


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值