- 1、本文档共14页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
用户和组管理基本用户环境主目录: 用户登录后所在的目录,名称与用户名相同,在/etc/passwd文件的最后一个域中指定。/etc/skel: 其中的目录及文件在新建用户时自动拷贝到用户主目录下。几个重要文件用户定义文件: /etc/passwd组定义文件: /etc/group口令文件: /etc/shadow一、用户和组文件用户账号文件——passwd passwd文件用于定义系统的用户账号,该文件位于“/etc”目录下。由于所有用户都对 passwd有读权限,所以该文件中只定义用户账号,而不保存口令。#11/etc/passwd-rw-r#11/etc/passwd-rw-r—r-- 1 root root 1359 May 23 16:09 /etc/passwd passwd文件中每行定义一个用户账号,一行中又划分为多个字段定义用户账号的不同属性,各字段间用“:”分隔。passwd文件的各字段如表6-1所示。//使用head命令查看passwd文件的前10行#head /etc/passwd//使用head命令查看passwd文件的前10行#head /etc/passwdroot:x:0:0:root:/root:/bin/bash表6-1 passwd文件按字段划分accountpasswordUIDGIDGECOSdirectoryshellrootx00root/root/bin/bashbinx10bin/bin/sbin/nologin passwd文件中各字段的含义如表6-2所示,其中少数字段的内容是可以为空的,但仍需使用“:”进行占位来表示该字段。字段命 名account用户账号名称,用户登录时所使用的用户名 password用户口令,出于安全性考虑,现在已经不使用该字段保存口令,而用字母“x”来填充该字段,真正的的密码保存在shadow文件中 UID用户号,惟一表示某用户的数宇 GID用户所属的私有组号,该数字对应group文件中的GIDGECOS可选的用户信息说明字段,通常用于保存用户全名的信息directory用户的宿主目录,用户成功登录后的默认目录shell用户所使用的shell,如该字段为空则使用“/bin/sh”用户口令文件——shadowshadow文件位于“/etc”目录中,用于存放用户口令等重要信息,所以该文件只有root用户可以读取。 与passwd文件类似,shadow文件中每行定义一个用户的信息,行中的各字段用“:”分隔。为了进一步提高安全性,shadow文件中保存的是已加密的口令。可以使用#head /etc/shadow命令查看前10行的内容。shadow文件的定义:Username:The name the user types when logging into the system. This allows the login appli-cationto retrieve the users password (and related information). Encrypted password:The 13 to 24 character password. The password is encrypted using either the crypt library function, or the md5 hash algorithm. In this field, values other than a validly-formatted encrypted or hashed password are used to control user logins and to show the password status. For example, if the value is ! or * the account is locked, and the user is not allowed to login. Date password last changed:The number of days since January 1, 1970 (also called the epoch)that the password was last changed. This information is used for the following password aging fields. Number of days before password can be changed:The minimum number of days that must p
文档评论(0)