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. .net mvc接收参数为null的解决方案

    1.通过对象接收请求数据时的null 必须为对象的属性设置get与set private System.String _EMail = System.String.Empty; public Syst ...

  2. cartographer保存地图

    手持激光,并用cartographer建图,保存的地图是.pbstream格式 ht@ht:~$ rosservice call /write_state /home/ht/Desktop/carto ...

  3. 《你不知道的javascript(上)》笔记

    作用域是什么 编译原理 分词/词法分析 这个过程会将由字符组成的字符串分解成(对编程语言来说)有意义的代码块,这些代码块被称为词法单元 解析/语法分析 词法单元流(数组)转换成一个由元素逐级嵌套所组成 ...

  4. 曼孚科技:数据标注,AI背后的百亿市场

    ​ 1. 两年前,来自山东农村的王磊成为了一位数据标注员.彼时的他,工作内容非常简单且枯燥:识别图片中人的性别. 然而,一段时间之后,他注意到分配给他的任务开始变得越来越复杂:从识别性别到年龄,从框选 ...

  5. 一些java基础知识的备忘

    接口和抽象类的区别是什么? 接口的方法默认是 public,所有方法在接口中不能有实现(Java 8 开始接口方法可以有默认实现),而抽象类可以有非抽象的方法. 接口中除了static.final变量 ...

  6. 【你不知道的javaScript 上卷 笔记6】javaScript中的对象相关内容

    一.创建一个对象的语法 var myObj = { key: value // ... };//字面量 var myObj = new Object(); //new myObj.key = valu ...

  7. 设置Eclipse中的字符集为UTF-8

    Eclipse 修改字符集 默认情况下 Eclipse 字符集为 GBK,但现在很多项目采用的是 UTF-8,这是我们就需要设置我们的 Eclipse 开发环境字符集为 UTF-8, 设置步骤如下: ...

  8. spring boot MySQL Public Key Retrieval is not allowed

    建议在链接url处添加对应的属性 jdbc:mysql://localhost:3306/book?allowPublicKeyRetrieval=true&useSSL=false 

  9. ReviewBoard使用:添加SVN

    1.登录ReviewBoard,选择“Admin” 2.选择 “Repositores”,点击按钮“Add” 3.填写内容,然后点击按钮“SAVE”保存 Name:仓库名称(自己随意写) Hostin ...

  10. js监听页面copy事件添加版权信息

    个人博客 地址:http://www.wenhaofan.com/article/20180921103346 1.介绍 当页面需要做版权保护时,比如当用户copy我们网站的文章时,我们会希望在他co ...