shell脚本(10)

通过位置变量创建 Linux 系统账户及密码

vim name.sh
#!/bin/bash
useradd "$1"
echo "$2" | passwd --stdin "$1"                                     
[root@ localhost ~]# sh name.sh szm 123
Changing password for user szm.
passwd: all authentication tokens updated successfully.
发布了68 篇原创文章 · 获赞 24 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/aaronszm/article/details/103604339