:





>   (  :),   )    root'y  
> /sbin/sh  /bin/ksh
>    /etc/passwd,  ,   
> /sbin/ksh.
> :
> $ su root -c /sbin/sh
>  .       .
>  ,  :  ?


   . .  -  ", 
  shell  ..." :-)

0.  shell - root' - : su root -m -s /bin/sh
              ,  -   
single user mode    CD/floppy/tape

1.      df,    /    , 
  ,      

   mknod    # mkdev, mknode, mksf -    
            #      

    ,  
- /dev/root (    "/"

   mknod /dev/root b 3 0x000002    #  

2.    //CD.
     install/update/system maintance  
"system maintence" (   root' shell)

    /dev/root  /mnt
  /mnt/etc/passwd

 No 1

          -      
    (!).      -
 mknode    .

 No 2

  vi      (  terminfo)      .
  .  

echo "toor::0:0:Yet another Super-User:/:" >> /mnt/etc/passwd
                                                 ^^^^^^

   >>     >  (  :-)


   :
PATH=$PATH:/mnt/bin:/mnt/usr/bin export PATH
TERMINFO=/mnt/usr/lib/terminfo   #    

  -      ,      
   ,           
  ,    .

     :  root passwd  Motorola Unix SVR4/88.

     1.  major/minor  /  /usr

104  0  /dev/root
104  3  /dev/dsk/m197_c0d0s3

     2.   ,   maintance .
     3.         ,    /    /usr,  
   (..       
  root ).

mkdir /mnt
mknod /dev/rootn b 104 0
/etc/fs/ufs/fsck /dev/rootn
mount -F ufs /dev/rootn /mnt

       /usr

mknod /dev/usr3 b 104 3
/etc/fs/ufs/fsck /dev/usr3
mount -F ufs /dev/usr3 /mnt/usr

     4.  /etc/passwd,   root

echo "toor::0:1:Adm:/:/sbin/sh" >> /mnt/etc/passwd

     5. C  root' (  /mnt)

chroot /mnt /sbin/sh

     6.  shadow

pwconv

.



 Date: 20 Apr 1997
 From: Bernshtam Pavel (barnshte@CS.bgu.ac.il)

        -   /etc/fstab   reboot 
  -  -  (    Axil    SunOS
4.1)  single user.

  ls - Command not found -  -   /usr

    SUN'    /sbin -  mount,
 -  /sbin/mount /usr.

 VI!

      set TERM   - 
VI.   fstab -    (  -  
  PICO,  VI !!!), , save' -  root partition 
READ ONLY !!!

 stop-A.

 ,  ,   boot-  
b  -rw  (    write),          
  mount  VI   /etc/fstab.

...   - VI     /var  , .
/tmp -   /var/tmp ,  VI  /tmp  .

/*     Linux    -  
read-write -   single-user-mode  

mount -n -o remount /
*/



       ,        ".*"   ".."
    rm -r .*

     ( unix'    ,   )


 From:  

"...          SCO-   Oracl 
     ..."

  # cd /usr/tmp
  # rm -rf *

,      /usr/tmp/.X11-0   ..
  

  # rm -rf .*   # !

  # du
ldd: Can not open file
  # df
ldd: Can not open file
  # ls -al
ldd: Can not open file


. . .

             .    , 
/usr/tmp/.*    /usr/tmp/..   reboot' ,
   /usr   .



       , Unix + TCP/IP -   
                 
  .

       1.           IP-,  
   ...  - , 

ifconfig eth0 down

        . 
ifconfig eth0 NEW-IP      .

       ,  _ _   
ifconfig eth0 down ; ifconfig eth0 NEW-IP up ; route add ...

      2.    security. 
 /etc/hosts.deny
ALL:ALL

 /etc/hosts.allow
ALL:193.263.12.13
        ^^^      ,  , 
 -    .



                 ,     reset  ,
,   ,    .  telnet'
  - .

         ,   - voila!



      Linux. 1993 .   LibC. , ,
- -  ,  -   .

 cd lib
 mv libc.so libc.so-old
 mv libc.so-new libc.so
ldd: Can not execute, shared library not found
     Finish.

        ,  hd.

     ,        ,       ,
   , .        
...       Linux. ,   
/sbin -  staticaly-linked -        
libc  .



      HP-UX     sam' 
- GUI,    -      .   
    -   - .
      ,  "Ok"  SAM    
trusted . ,   .      
,        root.  trusted 
    ,        
  -  .

         -      single  user  mode:  
  prompt IPL  

 IPL> hpux -is

   sam.     "untrusted"

 # mount -a
 # sam

               boot  - 
  .



Security  class  C2 -   .  
  .    - .
          SCO   
 ,  .  getty      
,        6-  ,   
  getty Login   "Intruder  attempts,  tty
line /dev/modem disabled".

          getty.



  screen-saver  ,   ?  ,  , 
   CTRL.

      /tmp. - root'.   

  rm -rf /tmp/*,   ,   
  rm -rf /_     - .

      ,      ,   __ 
. , ?

Last-modified: Mon, 08 Aug 2005 06:33:52 GMT
: