第6章-账户管理ppt课件_第1页
第6章-账户管理ppt课件_第2页
第6章-账户管理ppt课件_第3页
第6章-账户管理ppt课件_第4页
第6章-账户管理ppt课件_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、账户管理本章概要nLinux的账号与用户组n账号管理n用户身份切换nLinux上用户的对话与mailLinux的账号与用户组n用户虽然使用用户名密码登录、但是系统并不使用用户名标识用户,用户的每次登陆,系统都有两个ID去标识,就是UID(User ID)和 GID(Group ID)。n当用户要使用资源或者运行命令的时候,系统通过UID和GID对应的权限来验证时候有权限使用资源。Linux的账号与用户组登录验证用户名密码胜利UID和GID资源权限验证UIDGID胜利d rwx r-x r-x 421 401 401用户帐号文件n/etc/passwd和/etc/shadown每一行都代表一个帐

2、号root:x:0:0:root:/root:/bin/bash 用户名密码UIDGID用户SHELL阐明家目录用户组账号文件n/etc/group 与 /etc/gshadowroot:x:0:root 组名密码GID组内用户用户管理nuseradduseradd -u UID -g initial_group -G other_group -Mm -c 说明栏说明栏 -d home -s shell username 参数-u :后面接的是 UID ,是一组数字。直接指定一个特定的 UID 给这个帐号;-g :新建组,该用户属于该组。-G :新建组,该用户不仅属于该组,还属于用户默认组。-

3、M :强制!不要建立使用者家目录-m :强制!要建立使用者家目录!-c :这个就是 /etc/passwd 的第五栏的说明内容-d :指定某个目录成为家目录,而不要使用预设值;-p :指定密码-s :后面接一个 shell ,预设是 /bin/bashuseraddrootRHLinux root# useradd aaa -g studentrootRHLinux root# id -Gn aaastudentrootRHLinux root# useradd bbb -G studentrootRHLinux root# id -Gn bbbbbb studentrootRHLinux r

4、oot# useradd ccc -g student d /home/student相关命令npasswd 修改密码rootRHLinux root# passwdrootRHLinux root# passwd studentnusermod 修改用户rootRHLinux root# usermod -L studentrootRHLinux root# usermod U studentnuserdel 删除用户rootRHLinux root# userdel -r studentchshnchsh 更改默认shell参数-l :列出目前系统上面可用的 shell ,其实就是 /et

5、c/shells 的内容! -s :设定修改自己的 Shell rootRHLinux root# chsh -l /bin/sh /bin/bash /sbin/nologin /bin/ksh /bin/tcsh /bin/csh /bin/zsh rootRHLinux root# chsh -s /bin/csh; 相关命令nfinger 查询用户信息nid查询用户帐号相关信息rootRHLinux student# finger studentLogin: student Name: (null)Directory: /home/student Shell: /bin/bashOn

6、since Sun May 18 08:30 (CST) on pts/0 from 192.168.0.1No mail.No Plan.rootRHLinux student# id studentuid=500(student) gid=500(student) groups=500(student)用户组相关命令ngroupaddngroupmodngroupdelngpasswdrootRHLinux student# groupadd studentsrootRHLinux student# groupmod n stus studentsrootRHLinux student#

7、groupdel stusrootRHLinux student# gpasswd stusrootRHLinux student# gpasswd -ad student stus 用户身份切换nsu参数- :如果执行 su - 时,表示该使用者想要变换身份成为 root-l :后面可以接使用者,加载他的所有相关环境设定。-m :-m 与 -p 是一样的,表示使用目前的环境设定-c :仅进行一次指令,所以 -c 后面可以加上指令喔! rootRHLinux student# su -rootRHLinux student# su l studentrootRHLinux student# su - student c ll查询用户及登录信息nwn查询目前用户登录信息nwhon查询目

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论