通过bash脚本设置和重置用户密码

如何在Linux系统上通过bash脚本设置和重置用户密码。

创建新用户并设置密码。

用户名:test

密码:test123

#!/bin/bash
useradd test;echo test123|passwd test --stdin

重置密码

用户名:jack

密码:sort_1t_out

#!/bin/bash
echo sort_1t_out|passwd jack --stdin
日期:2019-08-20 17:58:29 来源:oir作者:oir