linux笔记_day06

Posted 求知若饥,虚心若愚。

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux笔记_day06相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

day06_JDBC学习笔记

linux笔记_day03

linux笔记_day08

linux笔记_day09

Linux的学习笔记_Day1

Linux课程笔记 Day06 课上内容总结