daveb
23rd February 2008, 20:36
The last few days I been trying to get crontabs working in a chroot jail so users within that jail can add cron jobs. So far I am able to create cron jobs via crontab via jailed users which is getting me closer to the goal. The problem at the moment is the cron jobs are not executed and I can find no log info of errors . This is currently what I have done and would appreciate any help on this.
using a debian etch base install nothing more for testing
I did this using the howto http://www.howtoforge.com/chroot_ssh_sftp_debian_etch
using section 2 - 2.3 of howto
apps added to create_chroot_env script:
/bin/cat
/bin/chmod
/bin/touch
/bin/nano
/usr/bin/editor
/usr/bin/crontab
/usr/bin/nano
/usr/sbin/cron <-- not sure if needed within chroot..
dir's and files added to chroot enviroment:
cd /home/chroot
mkdir lib/terminfo
mkdir lib/terminfo/x
cp /lib/terminfo/x/* ./lib/terminfo/x/
mkdir tmp
chmod 1777 tmp
mkdir var
mkdir var/spool
mkdir var/spool/cron
mkdir usr/sbin
cp -R /var/spool/* ./var/spool/
cp -R /var/spool/cron/* ./var/spool/cron/
chmod 1733 var/spool/cron/crontabs <--- confused as I had to add chmod "other with writable and exacutable permisions"
chown root:crontab var/spool/cron/crontabs
chown daemon:daemon var/spool/cron/atjobs
chmod 1770 var/spool/cron/atjobs
chown daemon:daemon var/spool/cron/atspool
chmod 1770 var/spool/cron/atspool
Thanks Dave
using a debian etch base install nothing more for testing
I did this using the howto http://www.howtoforge.com/chroot_ssh_sftp_debian_etch
using section 2 - 2.3 of howto
apps added to create_chroot_env script:
/bin/cat
/bin/chmod
/bin/touch
/bin/nano
/usr/bin/editor
/usr/bin/crontab
/usr/bin/nano
/usr/sbin/cron <-- not sure if needed within chroot..
dir's and files added to chroot enviroment:
cd /home/chroot
mkdir lib/terminfo
mkdir lib/terminfo/x
cp /lib/terminfo/x/* ./lib/terminfo/x/
mkdir tmp
chmod 1777 tmp
mkdir var
mkdir var/spool
mkdir var/spool/cron
mkdir usr/sbin
cp -R /var/spool/* ./var/spool/
cp -R /var/spool/cron/* ./var/spool/cron/
chmod 1733 var/spool/cron/crontabs <--- confused as I had to add chmod "other with writable and exacutable permisions"
chown root:crontab var/spool/cron/crontabs
chown daemon:daemon var/spool/cron/atjobs
chmod 1770 var/spool/cron/atjobs
chown daemon:daemon var/spool/cron/atspool
chmod 1770 var/spool/cron/atspool
Thanks Dave