1.用户:表示符,凭证

2.用户组:表示符

进程也是有属主和属组的

安全上下文(secure context):

用户:UID,/etc/pawwd

组:GID ,/etc/group

影子口令:

  用户:/etc/shadow

   组:/etc/gshadow

用户类别:

  管理员:uid=0

  普通用户:1-65535

    系统用户1-499(后台进程的属主)

    一般用户500-60000

用户组类别:

  基本组:用户的默认组

  私有组: 在创建用户时,如果没有给用户指定其所属的组,系统会默认给用户创建一个和用户同名的组。

  附加组:

进程被发起之前是个可执行文件,文件执行之前的权限,进程的权限是进程发起者的身份(进程可以使用那些资源文件,由发起者决定,不是文件的所属者)

[root@good eric usr]# whatis passwd
passwd (1) - update user's authentication tokens
passwd (5) - password file
passwd [sslpasswd] (1ssl) - compute password hashes
[root@good eric usr]# man 5 passwd The field descriptions are: account the name of the user on the system. It should not contain capital letters. password the encrypted user password, an asterisk (*), or the letter 'x'. (See pwconv(8) for an expla-
nation of 'x'.) UID the numerical user ID. GID the numerical primary group ID for this user. GECOS This field is optional and only used for informational purposes. Usually, it contains the full
username. GECOS means General Electric Comprehensive Operating System, which has been renamed
to GCOS when GE’s large systems division was sold to Honeywell. Dennis Ritchie has reported:
"Sometimes we sent printer output or batch jobs to the GCOS machine. The gcos field in the
password file was a place to stash the information for the $IDENTcard. Not elegant." directory the user’s $HOME directory. shell the program to run at login (if empty, use /bin/sh). If set to a non-existing executable, the
user will be unable to login through login(1).用户默认shell

添加用户

    

[root@good eric usr]# which useradd
/usr/sbin/useradd
[root@good eric usr]# ls -l `which useradd`
-rwxr-x---. 1 root root 111320 Feb 9 2016 /usr/sbin/useradd
[root@good eric usr]# useradd tom
[root@good eric usr]# tail -1 /etc/passwd
tom:x:501:501::/home/tom:/bin/bash
[root@good eric usr]# tail -1 /etc/shadow
tom:!!:17299:0:99999:7:::
[root@good eric usr]# passwd tom
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@good eric usr]# tail -1 /etc/shadow
tom:$1$0G6ELf7b$W46ShX5zObXOfepp6Eb8p/:17299:0:99999:7:::
[root@good eric usr]# [root@good eric default]# cd /etc/default/
[root@good eric default]# ls
nss useradd
[root@good eric default]# file useradd
useradd: ASCII text
[root@good eric default]#

useradd -c The ‘-c‘ option allows you to add custom comments, such as user’s full name, phone number, etc to /etc/passwd file

linux笔记_day06的更多相关文章

  1. 【Linux笔记】Linux目录结构

    [Linux笔记]Linux目录结构   本文内容整理自网络,以作参考. /:根目录,位于linux文件系统目录结构的顶层,一般根目录下只存放目录,不要存放文件,/etc./bin./dev./lib ...

  2. Linux 笔记 #03# 在 Debian远程服务器上运行 Java socket程序

    我试图做什么:把我的破代码放到服务器上运行,并成功与客户端进行 socket通信. 预备环境:刚安装好 MySQL 和 JVM 的 Linux远程服务器(Debian 8)一台. 主要有如下几个步骤: ...

  3. 《学渣Linux笔记》——关于.bashrc与profile(涉及交互式与非交互式、登录与非登录shell)

    <学渣Linux笔记>--关于.bashrc与profile(涉及交互式与非交互式.登录与非登录shell) 1.基本概念(个人理解) 交互式shell:等待用户输入,并执行相应操作的sh ...

  4. 《学渣Linux笔记》——更改ls命令的输出颜色和命令提示符颜色(二)

    <学渣Linux笔记>--更改ls命令的输出颜色和命令提示符颜色(二) II.更改命令提示符颜色 命令提示符的显示格式是由变量PS1决定的,首先我们查找GNU官方手册,发现如下内容(不是我 ...

  5. Linux笔记(二)

    Linux笔记(二) 一.软件包管理 1.rpm命令使用:Linux安装软件包的三种方法 rpm工具类似于Windows的exe文件,可以直接进行安装,而且安装路径和文件名一般都是固定好的. 在Cen ...

  6. linux笔记(一)——基本命令和快捷键

    linux笔记(一) 1.常用BASH快捷键 编辑命令 快捷键 作用 Ctrl + a 移到命令行首 Ctrl + e 移到命令行尾 Ctrl + xx 在命令行首和光标之间移动 Ctrl + u 从 ...

  7. Ubuntu/Linux 笔记应用 为知笔记(支持markdown)

    发现网易云笔记没有Linux,但是为知笔记有Linux版本,且支持markdown格式 sudo add-apt-repository ppa:wiznote-team sudo apt-get up ...

  8. Linux 笔记 #04# Installing Tomcat 8 on Debian

    失败一 ※ 失败二  ※ 失败三 ※ 完 1- 确认机型: root@iZwz:~# lsb_release -a LSB Version: core-2.0-amd64:core-2.0-noarc ...

  9. Linux笔记-Linux的命令初解1

    我是一个Linux的初学者,经验肯定没有大牛们那么全面,但是我很想把自己在学习过程中的所有所学和一些自己的感悟写下来. 首先我主要看的书为<鸟哥的私房菜>,这是一本非常棒的书,但是你会发现 ...

随机推荐

  1. Codeforces976E Well played! 【贪心】

    题目分析: 由于乘二的收获很大,所以我们可以证明乘的数一定是同一个,接着排序后依次选取,判断一下即可. 题目代码: #include<bits/stdc++.h> using namesp ...

  2. 【ZOJ2276】Lara Croft(bfs)

    BUPT2017 wintertraining(16) #4 D ZOJ - 2276 题意 n个数字绕成环,有两个指示数字的方块,每次可以顺时针或逆时针移动其中一个,步数是它当前位置的数字a[i], ...

  3. 【Gym 100733D】Little thief Shi(取数,DP)

    题 Shi realized that he was almost out of money, even renting Shitalian lands. Shi was walking on a s ...

  4. 自学Python5.3-类和对象的简单操作

    自学Python之路 自学Python5.3-类和对象的简单操作 1. 定义一个类 定义一个类的格式如下: class 类名: 方法列表 举例1 : class Cat: #定义一个Cat类 #属性 ...

  5. [luogu5002]专心OI - 找祖先

    [传送门] 我们还是先将一下算法的步骤,待会再解释起来方便一点. 算法步骤 首先我们算出每个子树的\(size\). 我们就设当前访问的节点 然后我们就得到了当前这个节点的答案是这个树整个的\(siz ...

  6. Azure Powershell script检测登陆并部署ARM Template

    本文简单提供了一个Azure powershell脚本,能实现如下功能 Azure (China)账户是否已经登陆了,如果没登陆,会提示你登陆. 要创建的资源组是否存在,存在的话不再创建,直接部署te ...

  7. jar包注册为Linux服务

    如果是SpringBoot项目,则需修改配置pom.xml为: <build> <plugins> <plugin> <groupId>org.spri ...

  8. 费马定理&欧拉定理

    费马定理: ap≡a(mod p) 其中p为质数,且a不是p的倍数 证明: ..... 欧拉定理: aφ(p)≡1(mod p) φ(x)(欧拉函数)为小于等于x且与x互质的数的个数 φ(x)=∏(p ...

  9. maven 排除test测试类

    <!-- 不编译test --> <plugin> <groupId>org.apache.maven.plugins</groupId> <ar ...

  10. JSONObject的toBean 和 fromObject

    public static void main(String[] args) { Map map=new HashMap(); map.put("我","妹") ...