home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / bsd / 10736 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  2.9 KB

  1. Xref: sparky comp.unix.bsd:10736 comp.unix.questions:15024
  2. Path: sparky!uunet!dtix!darwin.sura.net!convex!rdavis
  3. From: rdavis@convex.com (Ray Davis)
  4. Newsgroups: comp.unix.bsd,comp.unix.questions
  5. Subject: Re: WEIRD IDEA? (chroot)
  6. Message-ID: <rdavis.725658330@connie.de.convex.com>
  7. Date: 29 Dec 92 19:45:30 GMT
  8. References: <1992Dec26.191816.26596@prime.mdata.fi>
  9. Sender: usenet@convex.com (news access account)
  10. Organization: CONVEX Computer Corporation, Richardson, Tx., USA
  11. Lines: 53
  12. Nntp-Posting-Host: connie.de.convex.com
  13. X-Disclaimer: This message was written by a user at CONVEX Computer
  14.               Corp. The opinions expressed are those of the user and
  15.               not necessarily those of CONVEX.
  16.  
  17. karttu@mits.mdata.fi (Antti Karttunen) writes about using chroot(2)
  18. for guest login security:
  19.  
  20. You're in the right direction.  I've done this before and it works
  21. fine.  In my case, it was a bad idea to replace /bin/foo with a
  22. symlink to /usr/customers/bin/foo, so I either made copies of the
  23. files or I used a local nfs mount.  For each filesystem (/usr for
  24. example) I created a /usr/secure directory which had the /usr
  25. heierarchy in it and hard links to the files I needed.  If the
  26. directory to be chrooted to was /usr/customers, then I would mount
  27. each secure filesystem under that like:
  28.  
  29.     mount localhost:/usr/secure /usr/customers/usr
  30.  
  31. This of course will be more overhead than your symlink solution,
  32. but might be useful for things like the mail spool directory.
  33.  
  34. >chroot function for these special users, in the patched login I'm
  35. >about to hack.
  36.  
  37. You may not need to hack login if you don't want.  Just make these
  38. users have a shell which is a setuid root program that does the
  39. chroot and execs `/bin/login username' again (this will actually
  40. be the /bin/login in the customers heierarchy).
  41.  
  42. >About devices in /dev,  man chroot  gives the following warning:
  43. >
  44. >  BUGS
  45. >       One should exercise extreme caution when    referencing device
  46. >       files in    the new    root file system.
  47.  
  48. This is because two separate device files pointing to the same
  49. device may cause permission problems.
  50.  
  51. >3) If this chrooting is not so wonderful idea after all, does there
  52. >exist SysV-esque rsh for BSD4.3 anywhere? (I mean the Restricted Shell,
  53. >not Remote Shell). If you answer only to this last question, then
  54. >please do it with mail, and I will then summarize.
  55.  
  56. An rsh will be much simpler, of course, but perhaps not as secure
  57. since you have to worry not only about chdir and file access in
  58. the shell but in every application you let them use.
  59.  
  60. We have a s5r2 sh and a ksh under ConvexOS (a 4.* derivative) which
  61. can be used as a restricted rsh.  Of course this conflicts with the
  62. BSD rsh networking command if you name them rsh, but you can name
  63. them r*anything*sh (like rksh for example).
  64.  
  65. Have fun!
  66. Ray
  67. ___
  68. Ray Davis               Convex Computer GmbH, Frankfurt, Germany
  69. rdavis@masschaos.de.convex.com,   CompuServe: 72657,2154,   +49-69-666-8081
  70.