Chrooting

DanBUK edited this page Jan 23, 2011 · 3 revisions

When you want to jail a process you're gonna need to chroot them (you need to be root to use chroot).

var daemontools = require('daemon-tools');
daemontools.chroot("/home/dan/inscure_app");
process.chdir("/");

This will make all file accesses appear to be / even though it's actually /home/dan/inscure_app.