1••setuid•chownchgrp•umask•()1)2)3)shell1)2)3)1.1•••••i••ls-lshelltotal4232-rwxr-xr-x999rwxr-xr-xrwx1rootrootroot(root)3578KOct1404:44dmesg1.2ls-ldl()sbcp-1.3touch$touchmyfilels-l2shell()rw-r--radmin1-1ls-l()-()rw-()r--()r--()1)2)()3)rw/xmyfile-rw-r--r--myfileumask(1-2)1-2r--------r--r-----()r--r--r--rwxr--r--rwxr-x---13rwxr-xr-xrw-rw----rw-rw-r--rw-rw----1.4()chmod1.4.1chmodchmod[who]operator[permission]filenamewhougoa()operator+-=permissionrwxsset-IDt*lu,g,o*tttt()t4shell1.4.2chmodchmodmyfilerwxrwxrwxchmoda-xmyfilerw-rw-rw-chmodog-wmyfilerw-r--r--chmodg+wmyfilerw-rw-r--chmodu+xmyfilerwxrw-r--chmodgo+xmyfilerwxrwxr-xmyfile()$chmodu+xo-wmyfilemyfileadmin$chmodu+xdt1.4.3chmodchmod[mode]filemode1-31-3/0400001002000004010000020040000100201-31-37156440400+0200()=06000040()=00400004()=000406441-41-4rwxrwxrwx4+2+14+2+14+2+11-4myfilerw-r--r--4+2446441.4.4chmodchmodchmod666rw-rw-rw-chmod644rw-r--r--chmod744rwxr--r--chmod664rw-rw-r--chmod700rwx------chmod444r--r--r--yoaadminchmod644*6shell-Rchmod-R664/usr/local/home/dave/*/usr/local/home/dave-R1.4.51.5chmod1-51-61-5rwx1-6drwxrwxr-x(775)drwxr-xr--(754)drwxr-xr-x(755)--xdocspayadminadmin1.6suid/guidsuidguid17suidshellguid1.6.1suid/guidguidUNIXsuidguid/bin/sbin$ls-l|grep'^...s'suid$ls-l|grep'^...s..s'suidguidsuidsuid4guid24+2sxsuidguidguidloginsuidrwxrw-r--(741)chmod4chmod4741rwsrw-r--$chmod4741logit1.6.2suid/guid1-7suid/guidchmod4755rwsr-xr-xsuidchmod6711rws--s--ssuidguidchmod4764rwsrw-r--suid8shellsuid/guidrwxr-xr-xsuidchmodu+sfilenamerwsr-xr-xsuidrwSr-xr-xSsuidchmodchmod1.7chownchgrp/etc/passwdIDsuidchownchmod-R-hownerfile-R-h1.7.1chownprojectlouisepauline1.7.2chgrpchgrpchownpaulineadminsybadmin1.7.319id1.7.4mattysybadminappsgenpost1.8umaskumaskchmodumaskumaskshellumaskumask/etc/profileumaskumask$HOME.profile.bash_profile1.8.1umaskumask()umask6chmodumask7umasknnnnnnumask000-777umaskumaskumask1-8umaskumask/umaskumask002664775umaskumask10shell1-8umaskumask067166245344423522601700umask002777()umask002umask0021)rwxrwxrwx(777)2)umask002-------w-3)rwxrwxr-x(775)4)rw-rw-r--(664)umask0221)rwxrwxrwx(777)2)umask022----w--w-3)rwxr-xr-x(755)4)rw-r--r--(644)1.8.2umask1-9umask1-9umaskumask022755644027750640002775664006771660007770660umaskumask111umaskumask$umask002umaskumask/umask600/0661.91.9.1/usr/local/admin/sales$HOME$HOME$HOME/usr/opt/app/logln[-s]source_pathtarget_path1.9.240$HOME.profile/usr/local/menus/profilesales.profileadmin.profile$HOMEsales.profile$HOMEadmin.profiletarget_pathln12shellmatty()profile40/usr/opt/monitor/regstar/var/adm/logs$ln-s/usr/opt/monitor/regstar/reg.log/var/adm/logs/monitor.log777rwxrwxrwx/var/tmp/var/tmp()ln/var/tmp/var1.10chmod-Rsuidsuid1132findxargs()Find•find•find•findxargsfind(NFS)findfind(30G)Findfindpathname-options[-print-exec-ok]pathnamefind./-printfind-execfindshell'comm-and'{}\;{}\-ok-execshell2.1findfind--name-perm-prunefind-depth-prunefind-user-group-mtime-n+n-nn+nnFind-atime-ctime-mtime-mtime-nogroup/etc/groups-nouser/etc/passwd-newerfile1!file2file1file2-typeb-d-c-p-l-f--sizen[c]nc-depth-fstype/etc/fstab-mountmount-followfind-cpiocpio2.1.1namefind$HOME*.txt~'pathname~$HOME$find~-name*.txt-print*.txt$find.-name*.txt-print$find.-name[A-Z]*-print/etchost$find/etc-namehost*-print$HOME$find~-name*-printfind.-print$find/-name*-print*.txtax37.txt2findxargs15$find.-name[a-z][a-z][0--9][0--9].txt-print2.1.2perm-perm755$find.-perm755-printfind-perm--perm007chmod$find.-perm-007-print2.1.3-prune-prune-depth-prunefind/apps/apps/bin$find/apps-name/apps/bin-prune-o-print2.1.4usernouser$HOMEdave$find~-userdave-print/etcuucp$find/etc-useruucp-print-nouser/etc/passwd-nouserfind/home$find/home-nouser-print2.1.5groupnogroupusernouserfind/appsaccts$find/apps-groupaccts-printnogroupfind$fine/-nogroup-print16shell2.1.6mtimemtimen+n5$find/-mtime-5-print/var/adm3$find/var/adm-mtime+3-print2.1.7-newernewest_file_name!oldest_file_namefindage.awkbelts.awkfindtouch23:4021:40find-newer$find.-newerdstamp-print2.1.8typeUNIXLINUX2findxargs17/etc$find/etc-typed-print$find.!-typed-print/etc$find/etc-typel-print2.1.9sizeblockNc1M$find.-size+1000000c-print/home/apache100$find/home/apache-size100c-print10512$find.-size+10-print2.1.10depthfinddepthfindfindfindCON.FILE$find/-nameCON.FILE-depth-print2.1.11mountfindmountXC$find.-name*.XC-mount-print2.1.12cpiocpiofindcpiocpio/etc/home/apps18shell\shell\//etc/etcfind/etc/home/appscpiocpioC65536B512C6553664K65536/10242.1.13execokshell-execfind-exec-execlsls-lrmlsexec{}\execprintfindls-lls-lfind-execfind-execls-l/logs5$findlogs-typef-mtime+5-execrm{}\;shellmvrm-execfind.LOG5yn-execgrepfind2findxargs19passwd*passwdpasswd.oldpasswd.bakgreprounder2.1.14findfindfind$HOME$find$HOME-print$find~-printsuid$find.-typef-perm4755-print0$find/-typef-size0-execls-l{}\;/var/logs7$find/var/logs-typef-mtime+7-execrm{}\;audit$find/-name-groupaudit-printAdmin.logadmin.log.001admin.log.002find/logs7admin.log999$find/logs-name'admin.log[0-9][0-9][0-9]'-atime+7-execrm{}\;$find.-typed-print-local-mount|sortrmt$find/dev/rmt-print2.2xargsfind-execf