您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > Linux中用户和用户组管理
LinuxLinuxLinuxLinuxLinuxLinuxLinux://://://:2006-11-2121:34:53Linux:2006-11-2121:35:21Shelluseradduseradd-ccomment-d-m-g-G-sShellShell-u-o#useraddCd/usr/sam-msamsam-d-msam/usr/sam/usr#useradd-s/bin/sh-ggroupCGadm,rootgemgemShell/bin/shgroupadmrootgroup/etc/passwd/etc/shadow,/etc/groupLinuxuserconf/etc/passwduserdel://:******Newpassword:*******Re-enternewpassword:*******#passwdsamNewpassword:*******Re-enternewpassword:*******passwd8#passwd-dsamsamsampasswd-l(lock)#passwd-lsam:2006-11-2121:35:59LinuxLinux/etc/groupgroupaddgroupadd-gGIDGID-o-gGIDGID#groupaddgroup1group11#groupadd-g101group2group2101groupdelgroupdel#groupdelgroup1group1groupmodgroupmod-gGID://:2006-11-2121:36:28/etc/passwd,/etc/shadow,/etc/group/etc/passwdLinux/etc/passwdcat/etc/passwdroot:x:0:0:Superuser:/:daemon:x:1:1:Systemdaemons:/etc:bin:x:2:2:Ownerofsystemcommands:/bin:sys:x:3:3:Ownerofsystemfiles:/usr/sys:adm:x:4:4:Systemaccounting:/usr/adm:uucp:x:5:5:UUCPadministrator:/usr/lib/uucp:auth:x:7:21:Authenticationadministrator:/tcb/files/auth:cron:x:9:16:Crondaemon:/usr/spool/cron:listen:x:37:4:Networkdaemon:/usr/net/nls:lp:x:71:18:Printeradministrator:/usr/spool/lp:sam:x:200:50:Samsan:/usr/sam:/bin/sh/etc/passwd(:)7::::::Shell8/(:)(.)(-)(+)/etc/passwd*Shell0655350root199100Linux500/etc/groupLinuxLinuxfingerShellShellLinuxLinuxShellsh(BourneShell),csh(CShell),ksh(KornShell),tcsh(TENEX/TOPS-20typeCShell),bash(BourneAgainShell)ShellShellshShell/bin/shShellLinuxpsuedousers/etc/passwdShell8-11/etc/passwdbinsysadmuucpUUCPlplplpdnobodyNFSaudit,cron,mail,usenet:::::::::/etc/passwd13{./0-9A-Za-z}SCOLinux197011/etc/shadowcat/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:::::*::0:0::::listen:*::0:0::::lp:*::0:0::::sam:EkdiSECLWPdSa:9740:0:0::::Linux/etc/passwdnewgrp/etc/group/etc/passwd(:):::/etc/passwdLinux*(,)/etc/group#cat/etc/grouproot::0:rootbin::2:root,binsys::3:root,uucpadm::4:root,admdaemon::5:root,daemonlp::7:root,lpusers::20:root,sam:2006-11-2121:37:19LinuxuseraddLinux1/etc/passwdUIDxuser.txtuser001::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.txt#newusersuser.txtvipwvi/etc/passwd/etc/passwd3/usr/sbin/pwunconv/etc/shadowshadow/etc/passwd/etc/shadowshadowshadowpassword#pwunconv4passwd.txtuser001:user002:user003:user004:user005::5root/usr/sbin/chpasswdchpasswd/usr/bin/passwd/etc/passwd#chpasswdpasswd.txt6/etc/passwd/usr/sbin/pwconvshadowpassword/etc/shadow#pwconv/home:2006-11-2121:37:42Linuxrootleaderrootsurootroot=(ALL)ALLliminglimingsudorootformatliming#sudo/usr/sbin/useraddsam/usr/sbinPATH=$PATH:/usr/sbin;exportPATHwhereisWetrustyouhavereceivedtheusuallecturefromthelocalSystemAdministrator.Itusuallyboilsdowntothesetwothings:#1)Respecttheprivacyofothers.#2)Thinkbeforeyoutype.:liminguseraddroot/etc/sudoersVisudo/etc/sudoersgemsunrebootshutdown/etc/sudoersgemsun=/usr/sbin/reboot/usr/sbin/shutdowngemreboot$sudo/usr/sbin/reboot%%cuugALL=(ALL)ALL/etc/sudoersUser_Alias,Host_Alias,Cmnd_AliasHost_AliasSERVER=
本文标题:Linux中用户和用户组管理
链接地址:https://www.777doc.com/doc-5502917 .html