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. CTF长久练习平台

    0x01 XCTF(攻防世界) 攻防世界是ctf爱好者很喜欢的一个平台,不仅是界面风格像大型游戏闯关,里面的各类题目涵盖的ctf题型很广,还分为新手区和进阶区两块: 并且可以在里面组队,做一道题还有相 ...

  2. 【Python】求n!

    阶乘是基斯顿·卡曼(Christian Kramp,1760-1826)于1808年发明的运算符号,是数学术语.一个正整数的阶乘(factorial)是所有小于及等于该数的正整数的积,并且0的阶乘为1 ...

  3. dcloud_base连接失败(root:admin123!@#qwe@tcp(192.168.8.205:3306)/dcloud_base) Error 1129: Host '192.168.8.205' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

    mysql -uroot -p admin123!@#qwe show global variables like '%max_connect_errors%'; set global max_con ...

  4. Wannafly Winter Camp 2020 Day 5I Practice for KD Tree - 二维线段树

    给定一个 \(n \times n\) 矩阵,先进行 \(m_1 \leq 5e4\) 次区间加,再进行 \(m_2 \leq 5e5\) 次询问,每次询问要求输出矩形区间内的最大数.\(n \leq ...

  5. c++中sort基础用法

    用法一:数组排序 对一个数组进行升序排序 #include <algorithm> #include <iostream> #include <cstdio> us ...

  6. vim编辑器-删除命令

    dd:删除游标所在的一整行(常用)   ndd:n为数字.删除光标所在的向下n行,例如20dd则是删除光标所在的向下20行   d1G:删除光标所在到第一行的所有数据   dG:删除光标所在到最后一行 ...

  7. Selenium3+python自动化011-unittest生成测试报告(HTMLTestRunner)

    批量执行完用例后,生成的测试报告是文本形式的,不够直观,为了更好的展示测试报告,最好是生成HTML格式的. unittest里面是不能生成html格式报告的,需要导入一个第三方的模块:HTMLTest ...

  8. android 如何查看socket、websocket通信数据 抓包

    怎么使用可以自行百度

  9. Python之二:基础知识

    1.常量: 1.1.数:5.1.23.9.25e-3 4种类型的数——整数.长整数.浮点数和复数 2是一个整数的例子. 长整数不过是大一些的整数. 3.23和52.3E-4是浮点数的例子.E标记表示1 ...

  10. js和jq跳转到另一个页面或者在另一个窗口打开页面

    $("#pic").click(function(){ location.href='newpage.html'; }); 上面的相当于<a href="newpa ...