不能root要用普通用户
#!/bin/bash name=$1 useradd -m $name -s /bin/bash sub=`echo $name|md5sum|head -c 5` echo "$name:$name$sub" >> user.txt echo "$name:$name$sub" | chpasswd mkdir -p /home/$name/.ssh touch /home/$name/.ssh/authorized_keys chown $name:$name -R /home/$name