useradd命令的常用的选项:
-g xxxx # 指定账号所属的 primary group,写gid和组名都可以的
-G xxxx # list of supplementary groups of the new account
-s xxxx # 指定login shell,一般默认/bin/bash,也可以指定/sbin/nologin
-p 'password' # encrypted password of the new account,即指定加密后的密文,注意:需要使用单引号强引用!
实例:
1、创建一个用户,指定主组,从属组,及加密密文(如果使用双引号包围,密码段可能为空):
useradd -g wheel -G wheel -p '$1$XylHS6wL$BTbutXVePmr4ShGXTD4S63' QQ5201351
尊重别人的劳动成果 转载请务必注明出处:https://www.cnblogs.com/5201351/p/13610348.html