#!/bin/bash

# 检查是否以root权限运行
if [ "$(id -u)" -ne 0 ]; then
   echo "请以root权限运行此脚本" >&2
   exit 1
fi

newname="heco"

#Add New User
useradd -d /home/$newname -s /bin/bash -m $newname
usermod -aG sudo $newname
# 修改用户a123密码为123
echo "$newname:123456" | chpasswd

echo "success, Name:$newname, PassWord:123456"
echo "logout, use $newname log in."
echo "run delname.sh to del user a123


# adduser heco
# usermod -aG sudo heco
# deluser --remove-home a123
