除了如何使用脚本设置密码外,我什么都清楚。通常,我会写:
passwd username
终端会提示输入密码。如何从文件中读取密码?
最佳答案
您可以使用:
passwd --stdin username < filename
来自 passwd(1) :
--stdin This option is used to indicate that passwd should read the new password from standard input, which can be a pipe.
关于linux bash shell : how to create user with username and password from file?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4232024/