I create a chroot environment, and I get the following structure in /home/jail/ (it’s ChrootDirectory, it’s also a hamster):

 bin dev lib64 etc и др. системные директории www - директория с сайтами chroot-пользователя 

those. it turns out the trash I would like to bring the structure /home/jail/ (aka ChrootDirectory, it’s a hamster) to the following form:

 .bin |__ bin |__ dev |__ lib64 |__ etc |__ и др. системные директории www - директория с сайтами chroot-пользователя 

Is it possible to achieve this somehow - maybe by changing the PATH, maybe by raising one chroot one level higher, maybe some other way?

  • Make .bin chroot, and in the directory .bin/www connect the external directory www through some mount --bind ? - andreymal
  • www should be on the same level with .bin , and already inside .bin should be all system directories. Those. when chroot-user enters his environment through SSH and SFTP, he sees .bin and www - Alexander
  • one
    This is impossible, because it will break the compatibility with most Linux programs that are designed to use "garbage" ways - andreymal
  • and if chroot is used only for sftp, then he doesn’t need all this tinsel ... - Fat-Zer
  • >> which are designed for the use of "garbage" ways ->)) Ok, then somehow I will decide otherwise. >> and if chroot is used only for sftp, then he doesn’t need all this tinsel-> Not only SFTP, but also SSH - Alexander

0