linux用户与组管理.doc_第1页
linux用户与组管理.doc_第2页
linux用户与组管理.doc_第3页
linux用户与组管理.doc_第4页
linux用户与组管理.doc_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

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

文档简介

Linux LinuxShell1useraddCODE:useradd CODE:-c comment -d -m-g -G -s Shell Shell-u -o 21CODE:# useradd Cd /usr/sam -m samsam-d-msam/usr/sam/usr2CODE:# useradd -s /bin/sh -g group CG adm,root gemgemShell/bin/shgroupadmrootgroup#groupadd groupgroupadd adm/etc/passwd/etc/shadow, /etc/groupLinuxuserconf3/etc/passwduserdelCODE:userdel -rCODE:# userdel samsam/etc/passwd, /etc/shadow, /etc/group4ShellusermodCODE:usermod -c, -d, -m, -g, -G, -s, -u-ouseraddCODE:-l CODE:# usermod -s /bin/ksh -d /home/z Cg developer samsamShellksh/home/zdeveloper5ShellpasswdCODE:passwd CODE:-l -u -d -f samCODE:$ passwdOld password:*New password:*Re-enter new password:*CODE:# passwd samNew password:*Re-enter new password:*passwd8CODE:# passwd -d samsamsampasswd-l(lock)CODE:# passwd -l samLinuxLinux Linux/etc/group1groupaddCODE:groupadd CODE:-g GID GID-o -gGIDGID1CODE:# groupadd group1group112CODE:#groupadd -g 101 group2group21012groupdelCODE:groupdel CODE:#groupdel group1group13groupmodCODE:groupmod CODE:-g GID -o -gGIDGID-n 1CODE:# groupmod -g 102 group2group21022CODE:# groupmod Cg 10000 -n group3 group2group210000group34newgrpCODE:$ newgrp rootrootroot/etc/passwd, /etc/shadow, /etc/group1/etc/passwdLinux/etc/passwdCODE: cat /etc/passwdroot:x:0:0:Superuser:/:daemon:x:1:1:System daemons:/etc:bin:x:2:2:Owner of system commands:/bin:sys:x:3:3:Owner of system files:/usr/sys:adm:x:4:4:System accounting:/usr/adm:uucp:x:5:5:UUCP administrator:/usr/lib/uucp:auth:x:7:21:Authentication administrator:/tcb/files/auth:cron:x:9:16:Cron daemon:/usr/spool/cron:listen:x:37:4:Network daemon:/usr/net/nls:lp:x:71:18:Printer administrator:/usr/spool/lp:sam:x:200:50:Sam san:/usr/sam:/bin/sh/etc/passwd(7CODE:Shell18/(.)(-)(+)2/etc/passwdLinux SVR4shadow/etc/shadow/etc/passwdx*3Shell065 5350root199100Linux5004/etc/group5)Linux Linuxfinger6)7)ShellShellLinuxLinuxShellsh(Bourne Shell), csh(C Shell), ksh(Korn Shell), tcsh(TENEX/TOPS-20 type C Shell), bash(Bourne Again Shell)ShellShellshShell/bin/shShellLinux psuedo users/etc/passwdShellCODE: bin sys adm uucp UUCPlp lplpdnobody NFSaudit, cron, mail, usenet/etc/passwdLinux/etc/shadow2/etc/shadow/etc/passwdpwconv/etc/passwd/etc/passwd:CODE:1/etc/passwd213 ./0-9A-Za-z 3SCO Linux 19701145678/etc/shadowCODE: cat /etc/shadowroot:Dnakfw28zf38w:8764:0:168:7:daemon:*:0:0:bin:*:0:0:sys:*:0:0:adm:*:0:0:uucp:*:0:0:nuucp:*:0:0:auth:*:0:0:cron:*:0:0:listen:*:0:0:lp:*:0:0:sam:EkdiSECLWPdSa:9740:0:0:3/etc/groupLinux /etc/passwdnewgrp/etc/group/etc/passwd(CODE:1/etc/passwd2Linux *34/b(,)/etc/group# cat /etc/groupCODE:root:0:rootbin:2:root,binsys:3:root,uucpadm:4:root,admdaemon:5:root,daemonlp:7:root,lpusers:20:root,samLinuxuseraddLinux1/etc/passwdUIDxuser.txtCODE:user001:600:100:user:/home/user001:/bin/bashuser002:601:100:user:/home/user002:/bin/bashuser003:602:100:user:/home/user003:/bin/bashuser004:603:100:user:/home/user004:/bin/bashuser005:604:100:user:/home/user005:/bin/bashuser006:605:100:user:/home/user006:/bin/bash2root/usr/sbin/newusersuser.txtCODE:# newusers user.txtvipwvi /etc/passwd/etc/passwd3/usr/sbin/pwunconv/etc/shadowshadow/etc/passwd/etc/shadowshadowshadow passwordCODE:# pwunconv4passwd.txtCODE:user001:user002:user003:user004:user005:user006:5root/usr/sbin/chpasswdchpasswd/usr/bin/passwd/etc/passwdCODE:# chpasswd passwd.txt6/etc/passwd/usr/sbin/pwconvshadow password/etc/shadowCODE:# pwconv/homeLinuxrootsurootrootwwwadmApache Web ServerhttpdwwwwwwadmwwwApache/usr/local/httpd/htdocsrootshutdownLinuxsudosudosudorootsudoroot1sudo/etc/sudoerssudo/etc/sudoersCODE:liming ALL=(ALL) ALLliminglimingsudorootformatlimingCODE:# sudo /usr/sbin/useradd sam/usr/sbinPATH=$PATH:/usr/sbin;export PATHwhereis CODE:We trust you have received the usual lecture from the local SystemAdministrator. It usually boils down to these two things:#1) Respect the privacy of others.#2) Think before you type.Password:liminguseraddroot/etc/sudoers Visudo/etc/sudoers2gemsunrebootshutdown/etc/sudoersCODE:gem sun=/usr/sbin/reboot/usr/sbin/shutdowngemrebootCODE:$ sudo /usr/sbin/reboot%CODE:%cuug ALL=(ALL) ALL3/etc/sudoersUser_Alias, Host_Alias, Cmnd_AliasCODE:Host_Alias SERVER=no1User_Alias ADMINS=liminggemCmnd_Alias SHUTDOWN=/usr/sbin/halt/usr/sbin/shutdown/usr/sbin/rebootADMINS SERVER=SHUTDOWN4CODE:ADMINS ALL=(ALL) NOPASSWD: ALLADMINSNOPASSWD:5sudoCODE:$ sudo ClCODE:User liming may run t

温馨提示

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

评论

0/150

提交评论