03_04_Linux
2016-11-09 21:50
239 查看
用户、组、权限
安全上下文(secure context)
权限
文件:
r:可读,可以使用类似cat等命令查看文件内容
w:可写
x:可执行 executable可以命令提示符下当作命令提交给内核运行
目录:
r:可以对目录执行ls等指令
w:可以在此目录创建文件
x:可以使用cd切换此目录,也可以使用ls -l查看文件详细信息
用户
用户:UID /etc/passwd
组:GID /etc/group
影子口令:
用户:/etc/shadow
组:/etc/gshadow
用户类别:
管理员:0
普通用户(系统用户、一般用户):1-65535
系统用户:1-499
一般用户:500-60000
用户组类别:
管理员组:
普通组:
系统组:
一般组:
X:占位密码(存在etc/shadow)
以双冒号隔开分别是
用户名:加密相关信息:最近一次修改密码天数:密码最短使用期限:密码最长使用期限:密码过期前提醒
加密相关信息以$隔开
$1:表示加密方式为MD5
$iINxcG9C:杂质
$JGPtCwNQxlgBXhlbd/qaC1:处理后的密文
加密方法:
对称加密:加密和解密使用同一个密码
公钥密码:每个密码都成对出现,一个为公钥(pubilc key),一个为私钥(secret key)
单项加密:散列加密:只能加密不能加密,提取数据特征码 (MD5 SHA1)
1、雪崩效应 小小改变会引起很大变化
2、输出长度不变
增加用户:
查看组信息:
添加组:
用户管理:useradd、userdel、usermod、passwd、chsh、chfn、finger、id、chage
组管理:groupadd、groupdel、groupmod、gpasswd
权限管理:chown、chgrp、chmod、umask
安全上下文(secure context)
权限
文件:
r:可读,可以使用类似cat等命令查看文件内容
w:可写
x:可执行 executable可以命令提示符下当作命令提交给内核运行
目录:
r:可以对目录执行ls等指令
w:可以在此目录创建文件
x:可以使用cd切换此目录,也可以使用ls -l查看文件详细信息
用户
用户:UID /etc/passwd
组:GID /etc/group
影子口令:
用户:/etc/shadow
组:/etc/gshadow
用户类别:
管理员:0
普通用户(系统用户、一般用户):1-65535
系统用户:1-499
一般用户:500-60000
用户组类别:
管理员组:
普通组:
系统组:
一般组:
[root@bogon /]# cat etc/passwd root:x:0:0:root:/root:/bin/bash
<pre name="code" class="html">[root@bogon /]# man 5 passwd
account the name of the user on the system. It should not contain cap-ital letters. password the encrypted user password, an asterisk (*), or the letter 'x'. (See pwconv(8) for an explanation 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 pur-root:用户名
X:占位密码(存在etc/shadow)
[root@bogon /]# cat etc/shadow root:$1$iINxcG9C$JGPtCwNQxlgBXhlbd/qaC1:17108:0:99999:7:::
<span style="font-family: Arial, Helvetica, sans-serif;">[root@bogon /]# man 5 passwd</span>
以双冒号隔开分别是
用户名:加密相关信息:最近一次修改密码天数:密码最短使用期限:密码最长使用期限:密码过期前提醒
加密相关信息以$隔开
$1:表示加密方式为MD5
$iINxcG9C:杂质
$JGPtCwNQxlgBXhlbd/qaC1:处理后的密文
加密方法:
对称加密:加密和解密使用同一个密码
公钥密码:每个密码都成对出现,一个为公钥(pubilc key),一个为私钥(secret key)
单项加密:散列加密:只能加密不能加密,提取数据特征码 (MD5 SHA1)
1、雪崩效应 小小改变会引起很大变化
2、输出长度不变
[root@bogon /]# md5sum etc/inittab 3f206e10339f61eaf8d378bf504db462 etc/inittab
[root@bogon /]# which useradd /usr/sbin/useradd [root@bogon /]# ls -l $(which useradd) -rwxr-x---. 1 root root 101168 Aug 2 2011 /usr/sbin/useradd
增加用户:
[root@bogon /]# useradd tom [root@bogon /]# tail -1 /etc/passwd tom:x:501:501::/home/tom:/bin/bash
[root@bogon /]# tail -1 /etc/shadow tom:!!:17115:0:99999:7:::更改tom密码:
[root@bogon /]# tail -1 /etc/shadow tom:$1$d4c068/C$HTnXcRJHW9ZNY5EBK4wiK0:17115:0:99999:7:::查看组:
[root@bogon /]# tail -1 /etc/group tom:x:501:查看default值:
[root@bogon /]# cd etc/default/ [root@bogon default]# ls nss useradd [root@bogon default]# file useradd useradd: ASCII text [root@bogon default]# cat useradd # useradd defaults file GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SHELL=/bin/bash SKEL=/etc/skel CREATE_MAIL_SPOOL=yes
查看组信息:
[root@bogon default]# cat /etc/group root:x:0: bin:x:1:bin,daemon daemon:x:2:bin,daemon
添加组:
[root@bogon default]# groupadd mygroup
<span style="font-family: Arial, Helvetica, sans-serif;">[root@bogon default]# tail -1 /etc/group</span>
<span style="font-family: Arial, Helvetica, sans-serif;">mygroup:x:502:</span>
用户管理:useradd、userdel、usermod、passwd、chsh、chfn、finger、id、chage
组管理:groupadd、groupdel、groupmod、gpasswd
权限管理:chown、chgrp、chmod、umask
相关文章推荐
- 04_03_Linux
- [鸟哥linux视频教程整理]04_03_Linux 管理及IO重定向
- 视频: 千重浪Linux系统调试技术培训 03-04_Basic_GCC_and_EXT
- 第三课 第四讲03_04_Linux用户及权限详解
- [鸟哥linux视频教程整理]03_04_Linux用户及权限详解
- 03_04 Linux用户及权限详解(上)
- 03.配置putty连接Linux系统,并实现中英文输入输出;配置vnc服务器
- Linux基础知识--(04)使用虚拟机安装CentOS 5.3
- 2009-04-03技术学习:wicket框架中DatePicker使用
- Linux_shell_文件安全与权限(04)
- chap04 Linux用户管理
- 剖析Linux系统启动过程 - chenchao03的专栏 - CSDNBlog
- ASP.NET Repeater_第五篇_分页03-04
- 04/03/09
- 10-03-04 把握
- Linux_shell_文件安全与权限(03)
- Linux文件查找命令find,xargs详述04
- Java语言介绍(04)开源项目(03)作业调度(01)Quartz
- Ubuntu/Linux入门介绍(04)-Ubuntu系统目录结构
- linux启动时挂载rootfs的几种方式 - chenchao03的专栏 - CSDNBlog