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

  1. Xref: sparky comp.unix.bsd:10641 comp.unix.questions:14977
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!think.com!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!news.funet.fi!fuug!prime!mits!karttu
  3. From: karttu@mits.mdata.fi (Antti Karttunen)
  4. Newsgroups: comp.unix.bsd,comp.unix.questions
  5. Subject: WEIRD IDEA? (chroot)
  6. Message-ID: <1992Dec26.191816.26596@prime.mdata.fi>
  7. Date: 26 Dec 92 19:18:16 GMT
  8. Sender: usenet@prime.mdata.fi (Usenet poster)
  9. Organization: MITS, Helsinki, Finland
  10. Lines: 70
  11. Nntp-Posting-Host: mits.mdata.fi
  12.  
  13. We are thinking about building a kind of unix BBS-system,
  14. and for one reason (don't ask me why) I would want to keep certain class
  15. of users segregated from the rest, and their id's in the separate
  16. passwd-file.
  17.  
  18. We probably will be using BSD 4.3, and I have thought about using the
  19. chroot function for these special users, in the patched login I'm
  20. about to hack.
  21.  
  22. Now, let's assume that the root-directory for these special users
  23. is called /usr/customers. To there I'll create subdirectories
  24. bin, dev, usr, etc, 'emulating' the real /bin, /dev, /usr and /etc
  25. directories, like is done with the most ftp-sites nowadays.
  26. I want to give these users access to certain commands but not to all,
  27. so I copy some commands from real /bin to our 'fake' /bin, namely
  28. /usr/customers/bin. Because we probably will have / and /usr in the
  29. separate filesystems I can't use hard links, and neither the symbolic links
  30. will work from 'inside' /usr/customers to 'outside' of it. To the rest of
  31. commands, programs and files in /usr/ucb, /usr/bin, /usr/games,
  32. /usr/local/bin and /usr/lib I can make hard links with ln.
  33. (Hmm, just realized that I could move some of the commands in /bin to
  34. /usr/customers/bin and then make symbolic links to them from the real /bin
  35. From 'outside' to 'inside' they will work, of course.)
  36.  
  37. There should be at least passwd and group files in the etc directory,
  38. and various programs need various other files there, and with them I can
  39. do the same trick, or use different files. For example, if using separate
  40. utmp file there, we could create the illusion that these special users
  41. are alone in the machine.
  42.  
  43. About devices in /dev,  man chroot  gives the following warning:
  44.  
  45.   BUGS
  46.        One should exercise extreme caution when    referencing device
  47.        files in    the new    root file system.
  48.  
  49. and then tells nothing about why this extreme caution is needed.
  50.  
  51. With these I could probably again move the tty-devices and others
  52. to /usr/customers/dev and then make symbolic links to them from /dev,
  53. or create devices with the same names into /usr/customers/dev
  54. with /etc/mknod command. Probably it's this latter case where we
  55. will run into more problems, if we have processes started by special
  56. and normal users trying to access the same devices via /dev and
  57. /usr/customers/dev, with differing protections and different owners
  58. in these device-files.
  59.  
  60. With mail there are probably some problems when considering the mail
  61. between special and other users (separate spool-directories), but I
  62. think they will be also solvable with symbolic links or weird alias-tricks.
  63.  
  64. Everything said above was probably self-evident for you, but now the
  65. main questions:
  66.  
  67. 1) Has anybody built this kind of system before, for _interactive_ users?
  68. (I don't mean the ftp-servers).
  69.  
  70. 2) Have I forgot anything essential, something which will run us
  71. into deep problems later? (If we want to use some software X or thing Y
  72. in the future.)
  73.  
  74. 3) If this chrooting is not so wonderful idea after all, does there
  75. exist SysV-esque rsh for BSD4.3 anywhere? (I mean the Restricted Shell,
  76. not Remote Shell). If you answer only to this last question, then
  77. please do it with mail, and I will then summarize.
  78.  
  79. I will be grateful for any comments and suggestions.
  80.  
  81. --
  82. Antti Karttunen / karttu@mits.mdata.fi / $B%"%s%C%F%#!!%+%k%C%H%%%M%s(J
  83.