How to chroot a process?

The place to post if you need help or advice

Moderators: ChriThor, LXF moderators

How to chroot a process?

Postby gm33 » Fri May 31, 2013 10:08 am

Hello people,

I'm creating a web game control panel, where people can manage their gameserver on a php made control panel.
But i have no idea how to create an jailed inviroment for the gameserver,
I've looked at possebilites for chroot, but i don't want the gameserver has any binaries of linux in it's directory.

What i'm looking for (Example):
Gameserver location: /home/gameservers/users/user873/
so all the gameserver files are in this path, but it needs to be jailed so if the gameserver is executing any kind of shell or trying to access any upper directory, it just get's denied!

Thanks in advance.
Posts: 1
Joined: Fri May 31, 2013 8:09 am

Postby Dutch_Master » Fri May 31, 2013 11:28 am

You can't. Not as you envision anyway. The way Linux is set up, applications need access to libraries et all in order to work. So, you need to implement a full chroot environment. That means that there are a number of files copied from the standard Linux install into the user's chroot directory. It may look like this:
Code: Select all
chroot /home/gameservers/users/user873/
LXF regular
Posts: 2592
Joined: Tue Mar 27, 2007 1:49 am

Return to Help!

Who is online

Users browsing this forum: No registered users and 1 guest