上传文件至 /
This commit is contained in:
parent
61e96dd601
commit
88217e6603
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
read -p "请输入你要添加的账号:" user
|
||||||
|
read -s -p "请输入你要修改的密码:" passwd
|
||||||
|
|
||||||
|
id $user &>/dev/null
|
||||||
|
|
||||||
|
if [ $? -eq 0 ];then
|
||||||
|
|
||||||
|
echo "user $user \ 已经存在了"
|
||||||
|
echo "密码稍后可以重置"
|
||||||
|
sleep 1
|
||||||
|
echo "密码修改完成了"
|
||||||
|
echo $passwd | passwd --stdin $user &>/dev/null
|
||||||
|
else
|
||||||
|
useradd $user
|
||||||
|
echo $passwd | passwd --stdin $user &>/dev/null
|
||||||
|
echo "新用户添加成功,密码修改完成"
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
Loading…
Reference in New Issue