.   , . - , . /usr/include/sys/acct.h. - , . - , shell- , , , , (). - , , - , - , . , . , . , , . , - , , - . , - , . , lpr, , setuid. , , shell- . , - . acct.h, . ASU , , - . - - , . - : -------------------------- | | cmd f uid tty btime | | more 0 russ 0 Sat Jul 5 01:25:59 1986 | ls 0 russ 0 Sat Jul 5 01:31:12 1986 | ps 0 russ 0 Sat Jul 5 01:31:59 1986 | id 0 russ 0 Sat Jul 5 01:34:00 1986 | pwd 0 russ 0 Sat Jul 5 01:34:12 1986 | sh 1% russ 0 Sat Jul 5 01:33:51 1986 | \__ shell | | sync 0 russ 0 Sat Jul 5 01:34:21 1986 | df 0 russ 0 Sat Jul 5 01:34:27 1986 | id 0 root 0 Sat Jul 5 01:34:37 1986 | sh 2# root 0 Sat Jul 5 01:34:33 1986 | \__ shell , | 2# , | root | , shell- , - . , 1 shell- . , Berkeley , System V . su , UNIX - su. - , su exec. , su, , /usr/adm/sulog, ps - , shell. - .   , - , ? , - , - chmod - . - , , , . - - , ? - , ! bin "" , "bin" - . "bin" . bin ( ), - . , - , - /bin /usr/bin, bin. , , , "chmod 4755 door", - . bin /etc/rc - ("run command"). , - . "chmod 777 /etc/passwd", , . - /usr/lib/crontab. System V. /usr/spool/cron/crontabs/xxx, xxx - crontab . /usr/lib/crontab bin. - - , , : * * * * * chmod 777 /etc/passwd * * * * * chmod 4755 /tmp/door * * * * * /bin/su root -c "chmod 777 /etc/passwd" , cron - init. init - , . , cron, . , cron . Cron , - . ( - ) . , - - su, chmod shell-, su. crontab /etc/rc!   . , - . - , ls, , , . , - , - . - " ". , , , . , - " ". , . - , . , - , . , - . clist , . , - , , - , .   , shell. -, . - . $PATH - , - $HOME/bin /bin /usr/bin PATH. - , , , , . - ls. , , . - , - . - - . , . - - ( , ).   , - , . , , - . , , , . "" . , .   , - , , UNIX DES . ( - DES .) - - , , - "" (salt) /etc/passwd . "" , 4096 - DES . , "" . , . - , . , ,- - crypt ( ). - , - , - , , .  . UNIX , - , - /etc/gettydefs. . . - . , "login incorrect" ("- "), . , - , . - - . - - . , , , , "incorrect", - . , , - .   , - . , - - , . , . . - , . . , , - . . , , - ,- /etc/mount. , - , - , . . - , mount - . - - . , - . , 4755. - . , - , . , , . , - . , , , - . - - mount . mount , - - . shell (SASH) UNIX - . , - - UNIX . . - , - UNIX. , - , . , - shell , . shell (SASH, standalone shell). , . . : mount umount. - . . , SASH , . - . SASH . : # /etc/mount /dev/fp001 /mnt <-- System V # /etc/mount /dev/hd0a /mnt <-- XENIX /mnt/*. , /etc/passwd - . - : # /mnt/bin/vi /mnt/etc/passwd # sync , . - UNIX . , - SASH. , . , ( ). - " " " - ". , -, , . - "" , , , , , .   , . , - , . - , . - , , - . - - - , .  , - . - . . chmod chown. , , - 0. , . , , , . . passwd passwd - UNIX. , - , - , UNIX - , - . - passwd , , , , - . . passwd , . crypt crypt . , - , , . , , , - . , , , ( ) . su su , , - . su : -------------------------------------------- | | : , | , , , ... | , | . | | | , , | /etc/passwd, | su, | "sorry" ( ), | . | : | su, | , | , | , , | , shell, | , | su ps, | shell. | - . , , su "" - . , - , . , su "" . . su , , . login login , passwd. , - , - . , - . login - . , - , . - . , login, . - , . , , . , - , , . , : crypt . - , - .   , . , .   , , , , - , . - - . , , . , Motorola 68000, (Processor Status Register), - PSW, -. PSW , , "- " . - , - , "" . , . - , . - , - , - . , , . , - , , . , . , . 68000, .   - "" . - os/sys?.c. 60 , - . - - . . , . , . , "" - . , , - " ". , , , , - - ( )!  , , , . , . , - , PSW ("" " "). , , , . - . - , - . (, , , ), , . , . ( /etc/master /usr/sys/conf/master) - , . - , . , - . . open , .. . - , open, "" , - . , . uucp login , uucp , . . uucp , uucp. . /usr/lib/uucp/L.sys , , . /etc/passwd , uucico shell-. - , - , , . , , . uucp - , - . uucp ( - ) . , .. . - , - , - . , , , ! - , .   , - . , , UNIX. System V, XENIX, System III Berkeley 4.2. - LOGNAME. mail , , - . , , - , - . vi - ps. - - , - . , , , , - vi , , - , - ps. , - vi . vi - . ex - . - ps, vi. vi, . - . - , , - , tmp, tmp - vi. tmp. ps. -------------------------------------------------------- : access -------------------------------------------------------- access  , .   access   access   1 : 2 # @(#) access v1.0 Show all free access logins Author: Russ Sage 4 if [ "$#" -gt "0" ] 5 then echo "access: too many arguments" >&2 6 echo "usage: access" >&2 7 exit 1 8 fi 10 grep '^[^:]*::' /etc/passwd || echo "All logins protected"  access? , , , .. . , - . , , . ? access? access grep , , . , . , "All logins protected" (" ").  , access ( 4-8) - , . , . , . 10 . - grep, .. . , fgrep, . , , : , , - , . - /etc/passwd, , ( ). . - , - - . /etc/passwd. grep , . grep , - . 10 - , . ---------------------------------------------------- : chkset ---------------------------------------------------- chkset  , - / .   chkset [-l] [dir ...]   chkset -l , , . "ls -d" , - . . ( S_ISUID S_ISGID - // /sys/stat.h. - . .)   1 : 2 # @(#) chkset v1.0 Check for set bits on Author: Russ Sage 4 FORM="-print" 5 SORT="sort" 7 if [ "`echo $1 | cut -c1`" = "-" ] 8 then case $1 in 9 -l) shift 10 FORM="-exec ls -ld {} ;" 11 SORT="sort +7";; 12 *) echo "usage: chkset [-l][file/dir ...]" >&2 13 exit 1;; 14 esac 15 fi 17 if [ "$#" -gt 0 ] 18 then SRC="$*" 19 else SRC="/" 20 fi 22 find $SRC \( -perm -4000 -o -perm -2000 \) $FORM | $SORT   FORM SORT SRC ,  chkset? , - , - . , - shell . . - - , , , - . shell, , (root). shell, , - . , shell, . shell-, - , , , . , : ) ( - ); ) , ; ) ; ) , - . shell- : ) , UNIX; ) , , ; ) , - ; ) , , , shell, , .