上传文件至 /

This commit is contained in:
xiaoshun 2024-05-30 20:48:06 +08:00
parent 61e96dd601
commit 88217e6603
1 changed files with 21 additions and 0 deletions

View File

@ -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