Linux command useradd

Purpose

       Learning linux command useradd to create a new user or update default new user information

 

Eevironment

       Ubuntu 16.04 terminal

 

Procdeure

       Source code:

# crate new user
useradd -s '/bin/bash' -m -G adm,sudo test # set new user password
passwd test #set root password
passwd root

Parameter description

  -c:加上备注文字,备注文字保存在passwd的备注栏中。

  -d:指定用户登入时的主目录,替换系统默认值/home/<用户名>

  -D:变更预设值。

  -e:指定账号的失效日期,日期格式为MM/DD/YY,例如06/30/12。缺省表示永久有效。

  -f:指定在密码过期后多少天即关闭该账号。如果为0账号立即被停用;如果为-1则账号一直可用。默认值为-1.

  -g:指定用户所属的群组。值可以使组名也可以是GID。用户组必须已经存在的,期默认值为100,即users。

  -G:指定用户所属的附加群组。

  -m:自动建立用户的登入目录。

  -M:不要自动建立用户的登入目录。

  -n:取消建立以用户名称为名的群组。

  -r:建立系统账号。

  -s:指定用户登入后所使用的shell。默认值为/bin/bash。

  -u:指定用户ID号。该值在系统中必须是唯一的。0~499默认是保留给系统用户账号使用的,所以该值必须大于499。

  

linux command useradd的更多相关文章

  1. Linux Command Backup

    User Structure linux command review 列出所有信号 找到名字后,kill 或者用ps找到 kill同名进程 每隔一秒高亮显示网络链接数的变化情况 启动关闭制定网卡 关 ...

  2. 《The Linux Command Line》 读书笔记04 Linux用户以及权限相关命令

    Linux用户以及权限相关命令 查看身份 id:Display user identity. 这个命令的输出会显示uid,gid和用户所属的组. uid即user ID,这是账户创建时被赋予的. gi ...

  3. 《The Linux Command Line》 读书笔记02 关于命令的命令

    <The Linux Command Line> 读书笔记02 关于命令的命令 命令的四种类型 type type—Indicate how a command name is inter ...

  4. 《The Linux Command Line》 读书笔记01 基本命令介绍

    <The Linux Command Line> 读书笔记01 基本命令介绍 1. What is the Shell? The Shell is a program that takes ...

  5. Linux Command Line Basics

    Most of this note comes from the Beginning the Linux Command Line, Second Edition by Sander van Vugt ...

  6. linux 的useradd 命令的p选项

     linux 的useradd 命令的p选项                错误用法: #useradd   gaojian   -p  gaojian                      #  ...

  7. Linux Command Line 解析

    Linux Command Line 解析 0 处理模型 Linux kernel的启动包括很多组件的初始化和相关配置,这些配置参数一般是通过command line进行配置的.在进行后续分析之前,先 ...

  8. 15 Examples To Master Linux Command Line History

    When you are using Linux command line frequently, using the history effectively can be a major produ ...

  9. 10 Interesting Linux Command Line Tricks and Tips Worth Knowing

    I passionately enjoy working with commands as they offer more control over a Linux system than GUIs( ...

随机推荐

  1. CSRF攻击和防护

    攻击模拟步骤: 防护方法: 在客户端向后端请求界面数据的时候,后端会往响应中的 cookie 中设置 csrf_token 的值 在 Form 表单中添加一个隐藏的的字段,值也是 csrf_token ...

  2. Codeforces 1077 F2 - Pictures with Kittens (hard version)

    F2 - Pictures with Kittens (hard version) 思路: 单调队列优化dp 代码: #pragma GCC optimize(2) #pragma GCC optim ...

  3. AtCoder Regular Contest 100 Equal Cut

    Equal Cut 思路: 枚举中间那个分界点,然后两边找使得切割后差值最小的点,这个可以用双指针 代码: #include<bits/stdc++.h> using namespace ...

  4. L1 正则为什么会使参数偏向稀疏

    2018-12-09 22:18:43 假设费用函数 L 与某个参数 x 的关系如图所示: 则最优的 x 在绿点处,x 非零. 现在施加 L2 regularization,新的费用函数()如图中蓝线 ...

  5. Oracle:如何创建一个只有查看权限的用户

    因为工作中测试环境和开发环境是分开的,所以开发有时处理bug时需要连接测试数据库,这样出现一个问题是有些开发会为了验证某些问题任意改动数据库的表和字段,对测试库造成污染.为了能够让开发连接测试环境,同 ...

  6. Ubuntu 16.04 构建 Headless VNC 服务器

    终于放弃 Vino 了, 稳定性太低了. 而且,拔了显示器之后,总出现分辨率不对的问题. 于是,构建了一个 xfce4 + tightvnc 的 解决方案. 1) 把Vino相关的自启动都关了. (v ...

  7. 恶意代码分析-使用apataDNS+inetsim模拟网络环境

    准备工作 虚拟机安装: Win7 Ubuntu apateDNS 密码:wplo inetsim 密码:ghla 客户端Win7需要做的工作 安装apateDNS 服务器端Ubuntu需要做的工作 下 ...

  8. JavaScript的几个概念简单理解(深入解释见You Don't know JavaScript这本书)

    ES201X是JavaScript的一个版本. ES2015新的feature let, const Scope, 块作用域 Hoisting Closures DataStructures: Obj ...

  9. PHP中工厂模式与策略模式区别

    策略模式需要自己动手去做,工厂模式是都准备好了你需要选择 工厂模式:有一天你决定去吃披萨,一看菜单,哦,种类很多呀,你就点了个培根披萨,过了二十分钟,你的披萨就来了就可以吃到了.但这个披萨是怎么做的, ...

  10. windows系统文件和linux系统文件

    windows系统文件和linux系统文件 1.单用户操作系统和多用户操作系统 单用户操作系统:指一台计算机在同一时间 只能由一个用户 使用,一个用户独自享用系统的全部硬件和软件资源 Windows ...