linux笔记_day06

2024-08-30 19:08
文章标签 linux 笔记 day06

本文主要是介绍linux笔记_day06,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

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 passwdThe 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 fullusername.  GECOS means General Electric Comprehensive Operating System, which has been  renamedto  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  thepassword 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, theuser 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

posted @ 2017-05-13 11:41 酸奶加绿茶 阅读( ...) 评论( ...) 编辑 收藏

这篇关于linux笔记_day06的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1121678

相关文章

Linux之systemV共享内存方式

《Linux之systemV共享内存方式》:本文主要介绍Linux之systemV共享内存方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、工作原理二、系统调用接口1、申请共享内存(一)key的获取(二)共享内存的申请2、将共享内存段连接到进程地址空间3、将

快速修复一个Panic的Linux内核的技巧

《快速修复一个Panic的Linux内核的技巧》Linux系统中运行了不当的mkinitcpio操作导致内核文件不能正常工作,重启的时候,内核启动中止于Panic状态,该怎么解决这个问题呢?下面我们就... 感谢China编程(www.chinasem.cn)网友 鸢一雨音 的投稿写这篇文章是有原因的。为了配置完

Linux命令之firewalld的用法

《Linux命令之firewalld的用法》:本文主要介绍Linux命令之firewalld的用法,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux命令之firewalld1、程序包2、启动firewalld3、配置文件4、firewalld规则定义的九大

Linux之计划任务和调度命令at/cron详解

《Linux之计划任务和调度命令at/cron详解》:本文主要介绍Linux之计划任务和调度命令at/cron的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux计划任务和调度命令at/cron一、计划任务二、命令{at}介绍三、命令语法及功能 :at

Linux下如何使用C++获取硬件信息

《Linux下如何使用C++获取硬件信息》这篇文章主要为大家详细介绍了如何使用C++实现获取CPU,主板,磁盘,BIOS信息等硬件信息,文中的示例代码讲解详细,感兴趣的小伙伴可以了解下... 目录方法获取CPU信息:读取"/proc/cpuinfo"文件获取磁盘信息:读取"/proc/diskstats"文

Linux内核参数配置与验证详细指南

《Linux内核参数配置与验证详细指南》在Linux系统运维和性能优化中,内核参数(sysctl)的配置至关重要,本文主要来聊聊如何配置与验证这些Linux内核参数,希望对大家有一定的帮助... 目录1. 引言2. 内核参数的作用3. 如何设置内核参数3.1 临时设置(重启失效)3.2 永久设置(重启仍生效

kali linux 无法登录root的问题及解决方法

《kalilinux无法登录root的问题及解决方法》:本文主要介绍kalilinux无法登录root的问题及解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,... 目录kali linux 无法登录root1、问题描述1.1、本地登录root1.2、ssh远程登录root2、

Linux ls命令操作详解

《Linuxls命令操作详解》通过ls命令,我们可以查看指定目录下的文件和子目录,并结合不同的选项获取详细的文件信息,如权限、大小、修改时间等,:本文主要介绍Linuxls命令详解,需要的朋友可... 目录1. 命令简介2. 命令的基本语法和用法2.1 语法格式2.2 使用示例2.2.1 列出当前目录下的文

利用Python快速搭建Markdown笔记发布系统

《利用Python快速搭建Markdown笔记发布系统》这篇文章主要为大家详细介绍了使用Python生态的成熟工具,在30分钟内搭建一个支持Markdown渲染、分类标签、全文搜索的私有化知识发布系统... 目录引言:为什么要自建知识博客一、技术选型:极简主义开发栈二、系统架构设计三、核心代码实现(分步解析

Linux中的计划任务(crontab)使用方式

《Linux中的计划任务(crontab)使用方式》:本文主要介绍Linux中的计划任务(crontab)使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、前言1、linux的起源与发展2、什么是计划任务(crontab)二、crontab基础1、cro