linux 创建用户和添加到组

1、添加用户

先用root用户登录

useradd -m testuser #这样的做会在/home下创建目录

2、指定shell

#cat /etc/passwd  #查看用户指定shell

root:x:0:0:root:/root:/bin/zsh

testuser:x:1002:1002::/home/testuser:

#usermod -s /bin/bash testuser

#cat /etc/passwd  #查看用户指定shell

testuser:x:1002:1002::/home/testuser:/bin/bash

原文地址:https://www.cnblogs.com/tonyjy/p/8458563.html