
比如 useradd –d /home/test –g 600 test test
你的机器上一定有一个shell脚本来完成账号密码的修改。建议看看《Linux就该这么学》
Linux就该这么学》是一本注重于实用性的Linux系统技术自学书籍,自基础篇公布后网站每天日常阅读量已经超过10000多人,25万多名忠实粉丝读者,是目前国内人气增速最快的IT书籍。您可以在本网站内免费在线阅读书籍的全部章节及最新内容,今后的进阶篇也将会一如既往免费、完整的提供给亲爱的读者们在线学习。
就像 slecrane 说的. 你写一个脚本来完成你的想法. 比如设置成什么样的密码.之后用 crontab来引用,每天执行自动设置就可以了.
密码的生成你可以自己用脚本来实现.
如果你是用 redhat 的系统有一个命令应该可以在脚本中方便的设置密码.它叫
chpasswd
DESCRIPTION
chpasswd reads a list of user name and password pairs from standard
input and uses this information to update a group of existing users.
Each line is of the format:
user_name:password
By default the supplied password must be in clear-text. Default
encryption algorithm is DES. Also the password age will be updated, if
present.
This command is intended to be used in a large system environment where
many accounts are created at a single time.
如果不是redhat 类的系统.也许你需要用 expect之类的程序来设置密码.
实现起来不难. 一定能做得出来.
linux修改root密码命令:1、以root身份登录。
2、打开终端输入:passwd 。
3、出现“New password: ”时输入第一次密码。
4、第一次密码输入完成后会出现“Retype new password: ”再次输入密码即可完成密码更改。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)