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. PostgreSQL安装及使用教程二(zip解压方式)

    下载postgre包  下载地址:https://www.postgresql.org/download/ 选DOWNLOADS--Windows--zip archive--version10.6- ...

  2. git push 使用

    git push命令用于将本地分支的更新,推送到远程主机.它的格式与git pull命令相仿. $ git push <远程主机名> <本地分支名>:<远程分支名> ...

  3. System.out.println 报错: 只能运行在方法体内哦, 类里面只包含属性和方法哦,注意!

    类里面包含属性和方法 所以, System.out.println,只能放在方法体内运行,不能放在类里.方法外哦

  4. iOS获取UUID

    转自:<iOS获取设备的唯一标识的方法总结以及最好的方法> 参考:<获取iOS设备唯一标识> 总结一下: 1.代码采用CFUUID+KeyChain的实现方式. 2.CFUUI ...

  5. ICO分享

  6. 【转】 C语言文件操作详解

    转自:http://www.cnblogs.com/likebeta/archive/2012/06/16/2551780.html C语言中没有输入输出语句,所有的输入输出功能都用 ANSI C提供 ...

  7. gem "ransack"(4000✨) 简单介绍

    Object-based searching:演示. git:  https://github.com/activerecord-hackery/ransack Gorails视频和我的博客记录:ht ...

  8. Can't find kernel text map area from kcore

    kernel : 4.9.51kexec-tools : 2.0.4 1.~ # ./kexec -p /boot/vmlinuz --initrd=/boot/initrd --command-li ...

  9. 文件上传MultipartBody使用方法

    最近有使用一个文件上传的功能,需要在请求中添加文件,一起传给服务器 Okhttp提供了这个文件添加然后上传的功能 下面给出核心的代码,然后分析一下 //多个文件上传,Filelist private ...

  10. Android开源框架源码分析:Okhttp

    一 请求与响应流程 1.1 请求的封装 1.2 请求的发送 1.3 请求的调度 二 拦截器 2.1 RetryAndFollowUpInterceptor 2.2 BridgeInterceptor ...