shell之批量新增用户脚本(http-basic-auth)
发布时间:2020-12-15 07:06:24 所属栏目:安全 来源:网络整理
导读:user.txt(用户名记录文件) test001@ 163 .comtest002@ 163 .com user.sh(shell脚本): for line in `cat user.txt` do echo $line " u " $line printf $line:$(openssl passwd -crypt $line)n " conf.d/ passwddone 执行完毕后,就可以在passwd看到对应的记
user.txt(用户名记录文件) test001@163.com test002@163.com user.sh(shell脚本): for line in `cat user.txt` do echo $line "u"$line printf $line:$(openssl passwd -crypt $line)n" >> conf.d/passwd done 执行完毕后,就可以在passwd看到对应的记录。 应用场景: (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |