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. 字符串问题----去掉字符串中连续出现K个0的子串

    去掉字符串中连续出现K个0的子串 给定一个字符串str,和一个整数k, 如果str中正好有连续K 个'0'字符出现,把连续的 k 个 '0'去掉,返回处理后的子串. [解题思路] 1. 定义两个变量, ...

  2. 在Windows启动pyspark shell:Failed to find Spark jars directory. You need to build Spark before running this program

    D:\Develop tools\spark-2.2.0-bin-hadoop2.7\bin>pyspark2.cmd 'tools\spark-2.2.0-bin-hadoop2.7\bin\ ...

  3. IDEA 和 Webstorm JAR包方式破解

    IDEA 和 Webstorm JAR包方式破解 IDEA 我是用的IDEA版本是 18.3,更新版本的IDEA很多激活码都不能用了,或者不好激活了. 首先下载相应的 软件版本 和破解 jar包. 下 ...

  4. 树莓派使用Python使用PiCamera录制视频

    个人博客 地址:https://www.wenhaofan.com/article/20190430144020 代码 在树莓派环境下官方提供了乐酷 PiCamera 让我们可以很方便的操作树莓派连接 ...

  5. BZOJ 2467: [中山市选2010]生成树

    有一种图形叫做五角形圈.一个五角形圈的中心有1个由n个顶点和n条边组成的圈.在中心的这个n边圈的每一条边同时也是某一个五角形的一条边,一共有n个不同的五角形.这些五角形只在五角形圈的中心的圈上有公共的 ...

  6. XSS漏洞原理

    注入型漏洞的本质都是服务端分不清用户输入的内容是数据还是指令代码,从而造成用户输入恶意代码传到服务端执行. 00x01js执行 Js是浏览器执行的前端语言,用户在存在xss漏洞的站点url后者能输入数 ...

  7. Git仓库创建---克隆仓库---初始提交代码

    1.在Git上创建仓库,添加成员,默认分支是“master”,仓库路径假设为http://192.168.1.1/root/project.git 2.在sourceTree上,点击“克隆”,输入上面 ...

  8. Codeforce 519B - A and B and Compilation Errors

    A and B are preparing themselves for programming contests. B loves to debug his code. But before he ...

  9. wa自动机 的 莫队 刷题记录

    洛谷P2709小B的询问 莫队裸题,模板题 莫队就是把询问区间排个序,先按左端点的Pos排序(POS是分块那个数组),pos一样的按右端点排序 代码: #include <bits/stdc++ ...

  10. C#继承是个啥

    继承: 字面意思就是继承 如地主老王有500亩地,老王的儿子小王可以种这五百亩地可以随便拿这五百亩地上面的任何东西 如Controller 你要用从一个controller调用另一个controlle ...