home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / admin / 4607 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  1.5 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!unido!open.de!mailbox!teddy!germany!open!ruhr.de!horga!reswi!cppdo!cppob!schweik
  2. From: schweik@cpp.ob.open.de (Martin Schweikert)
  3. Newsgroups: comp.unix.admin
  4. Subject: Prevent user from editing /etc/passwd
  5. Message-ID: <1992Aug17.131329.22491@cpp.ob.open.de>
  6. Date: 17 Aug 92 13:13:29 GMT
  7. Organization: Private/FRG
  8. Lines: 26
  9.  
  10. Hi!
  11.  
  12. I have a user on my SVR3 machine who knows - and must know :-( - the
  13. root password.
  14.  
  15. I tried to find a method to prevent him from editing /etc/passwd. It's
  16. quite difficult.
  17.  
  18. Because I know he uses vi, I tried to replace /usr/bin/vi by a shell
  19. script that tests if one of its parameters is *passwd. If so,
  20. it would write a message to my terminal, send me mail, and make a copy
  21. of /etc/passwd before it would invoke the original vi. Exactly here is
  22. the problem: vi (I don't know much about it :-) seems to check under
  23. what name it was invoked. And in my replacement script I invoked it
  24. with "vi.orig". So vi finds out it wasn't invoked as vi, vedit, ... and
  25. it seems that ex gets executed (I know perfectly nothing about ex).
  26.  
  27. Now, my question: is there another possibility than writing a C program
  28. that exec()s vi? Not that it was a problem to write such a program, but
  29. I would like to keep things as simple as possible ...
  30.  
  31. Martin
  32. -- 
  33. M. Schweikert-Oberhausen/Germany-schweik@cpp.ob.open.de /    My life is based on
  34.  <>< Life-Net: martin_schweikert@credo.zer (Joh3:16)   /   two things: Belief in
  35.    Fax: +49 208 85 97 108, Phone: +49 208 85 97 142   /  Christ and Murphy's Law
  36.