Chrooted SSH apps

Discussion in 'Tips/Tricks/Mods' started by bkrausz, Jul 17, 2006.

  1. bkrausz

    bkrausz New Member

    I'm trying to provide Nano and a couple of other apps for my users (I just upgraded to the latest ispconfig). I edited /root/ispconfig/scripts/shell/creat_chrooted_env.sh and added /bin/nano and /usr/bin/nano to APPS, and reran it, but whenever I try to run nano I get an "Error opening terminal: xterm." error. Any way I can include xterm in the chroot?

    Thanks!!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. bkrausz

    bkrausz New Member

    I spent a few hours hunting and I can't find exactly what you need to do to run xterm. I'm gonna try copying some more libs tomorrow...if anybody else is looking into this, please post, otherwise thanks for the recommendation till, I'll post if I find something.
     
  4. falko

    falko Super Moderator ISPConfig Developer

  5. bkrausz

    bkrausz New Member

    I did follow that howto...I found my problem.

    There needs to be a couple of xterm files from the etc dir in the folder. Here's how to add nano:

    EDIT /root/ispconfig/scripts/shell/create_chroot_env.sh
    ADD /bin/nano to the end of the APPS= line (before the last ")
    ADD at the bottom:
    #Allow nano to work
    mkdir ./etc/terminfo/x/
    cp /etc/terminfo/x/* ./etc/terminfo/x/

    And viola!
     
  6. Ovidiu

    Ovidiu Active Member

    ok, but how would I add more apps (i.e. nano ) after having done all that, shall I simply rerun the whole how-to with the changed settings including more libbs and apps?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no need of rerunning the howto.

    Just add the additional applications in the line APPS="....." in the file /root/ispconfig/scripts/shell/create_chroot_env.sh

    When you update or create a new user in ISPConfig, the chroot enviroment will be rebuild with all the applications listed in that line.
     
  8. Ovidiu

    Ovidiu Active Member

    I updated my user and nothing happened...

    I just tried to run the script manually:

    anything wrong doing this like this? I am root and trying to use the script for the user web1_postmaster
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Have you been logged in as web1_postmaster with a second console as you run the chroot script?
     
  10. Ovidiu

    Ovidiu Active Member

    no I did not.

    anyway this psot should be obsolte by now as my question has (almost) been answered in this post here: http://www.howtoforge.com/forums/showthread.php?t=1739&page=2

    it seems the script still has some error like it should say mkdir - p instead of just mkdir and severall other problems pointed out in that post.
     
  11. Ovidiu

    Ovidiu Active Member

    I want to include the sa-learn command into the shell so I can learn spams but I am not sure which sa-learn to include???

     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    /home/admispconfig/ispconfig/tools/spamassassin/usr/bin/sa-learn
     
  13. Ovidiu

    Ovidiu Active Member

    it needs perl:

    can you give me soem tipps how to include perl into the jail? Is it a security hole? I really need sa-learn... available to users or an automated version of it but as I am no programmer...
     
  14. falko

    falko Super Moderator ISPConfig Developer

  15. Ovidiu

    Ovidiu Active Member

    works wonderful
     

Share This Page