useradd 命令

Usage: useradd [options] LOGIN
useradd -D
useradd -D [options] Options:
-b, --base-dir BASE_DIR base directory for the home directory of the
new account
-c, --comment COMMENT GECOS field of the new account
-d, --home-dir HOME_DIR home directory of the new account
-D, --defaults print or change default useradd configuration
-e, --expiredate EXPIRE_DATE expiration date of the new account
-f, --inactive INACTIVE password inactivity period of the new account
-g, --gid GROUP name or ID of the primary group of the new
account
-G, --groups GROUPS list of supplementary groups of the new
account
-h, --help display this help message and exit
-k, --skel SKEL_DIR use this alternative skeleton directory
-K, --key KEY=VALUE override /etc/login.defs defaults
-l, --no-log-init do not add the user to the lastlog and
faillog databases
-m, --create-home create the user's home directory
-M, --no-create-home do not create the user's home directory
-N, --no-user-group do not create a group with the same name as
the user
-o, --non-unique allow to create users with duplicate
(non-unique) UID
-p, --password PASSWORD encrypted password of the new account
-r, --system create a system account
-R, --root CHROOT_DIR directory to chroot into
-P, --prefix PREFIX_DIR prefix directory where are located the /etc/* files
-s, --shell SHELL login shell of the new account
-u, --uid UID user ID of the new account
-U, --user-group create a group with the same name as the user
-Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping

常用:

a)

useradd testuser -c "c参数后面接注释信息" -p "用户密码"

b)

useradd testuser -M -s /sbin/nologin

#用户testuser 没有家目录,也不可以登陆

c)

删除用户userdel -r testuser

useradd与adduser的区别:centos上基本没有区别,ubuntu上有差别,

详细参考:https://www.cnblogs.com/whitehorse/p/5847278.html

centos useradd 命令详解的更多相关文章

  1. CentOS tree命令详解

    inux下tree命令详解---linux以树状图逐级列出目录的内容命令 ############################################################### ...

  2. CentOS Yum 命令详解

    总所周知,Redhat和Fedora的软件安装命令是rpm,但是用rpm安 装软件最大的麻烦就是需要手动寻找安装该软件所需要的一系列依赖关系,超级麻烦不说,要是软件不用了需要卸载的话由于卸载掉了某个依 ...

  3. centos alias命令详解

    Alias命令 功能描述:我们在进行系统的管理工作一定会有一些我们经常固定使用,但又很长的命令.那我们可以给这些这一长串的命令起一个别名.之后还需要这一长串命令时就可以直接以别名来替代了.系统中已经有 ...

  4. useradd命令详解(转)

    1.作用 useradd或adduser命令用来建立用户帐号和创建用户的起始目录,使用权限是超级用户. 2.格式 useradd [-d home] [-s shell] [-c comment] [ ...

  5. centos top 命令详解及退出top命令-使用p键及free命令

    1.作用 top命令用来显示执行中的程序进程,使用权限是所有用户. 2.格式 top [-] [d delay] [q] [c] [S] [s] [i] [n] 3.主要参数 d:指定更新的间隔,以秒 ...

  6. useradd命令详解

    功能说明:建立用户帐号.语 法:useradd [-mMnr][-c <备注>][-d <登入目录>][-e <有效期限>][-f <缓冲天数>][-g ...

  7. [转]CentOS Yum 命令详解

    总所周知,Redhat和Fedora的软件安装命令是rpm,但是用rpm安 装软件最大的麻烦就是需要手动寻找安装该软件所需要的一系列依赖关系,超级麻烦不说,要是软件不用了需要卸载的话由于卸载掉了某个依 ...

  8. useradd 命令详解

    useradd 作用: 用于Linux中创建的新的系统用户, useradd 可用来建立用户账号, 账号建好之后,再用passwd 设定账号的密码, 可用userdel 删除账号. 使用useradd ...

  9. 【转】centos关机与重启命令详解

    连接:http://blog.csdn.net/jiangzhengdong/article/details/8036594 Linux centos关机与重启命令详解与实战 Linux centos ...

随机推荐

  1. java中数据类型转换注意事项

    1.byte.short.char这三种类型互相做数学运算时都会先提升为int类型后再做运算 char a = 'A'; short b = 1; int num = a + b;//a和b在做运算前 ...

  2. 5G PDCCH 协议

    For downlink, a maximum of 16 HARQ processes per cell is supported by the UE. The number of processe ...

  3. VS中关于数据库的操作

    1.数据库迁移 第一步: 第二步: 在窗口中选择项目中的EntitiyFramwork项目(与数据库连接的文件集) 第三步: 输入update-database 二:数据对比 第一步: 第二步:选择需 ...

  4. jQuery---突出展示案例

    突出展示案例 <!DOCTYPE html> <html> <head lang="en"> <meta charset="UT ...

  5. aws申请ec2实例后如何用root用户登录

    ec2默认禁用root用户登录,我们创建ec2实例后如何知道使用什么用户登录,有两种方法? 方法一:根据我们选择的镜像来判断用什么用户登录:镜像:centos 用户centos镜像:aws 用户:ec ...

  6. 理解 Oracle 多租户体系中(12c,18c,19c)创建用户作用域范围

    本篇探讨以下几个问题:你可提前猜测下面6个场景语句中,哪几个可以成功创建用户? 1. 在CDB级别中创建公共用户,不带 container 子句的效果: 2. 在CDB级别中创建公共用户,带 cont ...

  7. vscode与MinGW64调试c++报错

    这个问题在刚配好环境测试的时候往往不会被发现,因为单纯的c++编译调试是没问题的.但一旦调试使用stl库的代码就会报错,而编译又没问题且可以正常运行,但在vscode的集成终端里运行不会显示任何本该显 ...

  8. Spring整合MyBatis案例练习笔记

    需求: 用户登录 技术需求: Servlet+Spring+Mybatis+MVC+jsp+css+html+jquery 数据库设计: 用户表 Sql语句设计: select * from t_us ...

  9. AUI前端框架总结

    AUI 是Apicloud 的手机端UI第三方,需要引入Apicloud和AUI中的css样式和js框架 **首先:手机项目必须配置config.xml文件 Apicloud官网有详解 ** 其次:程 ...

  10. react中用swiper实现大图功能

    1.引入Swiper(用的是4.5.0版本)      import Swiper from 'swiper';      //引入样式,还可以加上自己的样式      import '../../s ...