Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to chroot a process?

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
gm33



Joined: Fri May 31, 2013 9:09 am
Posts: 1

PostPosted: Fri May 31, 2013 11:08 am    Post subject: How to chroot a process? Reply with quote

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.
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2435

PostPosted: Fri May 31, 2013 12:28 pm    Post subject: Reply with quote

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:
chroot /home/gameservers/users/user873/
ls
/home/gameservers/users/user873/etc/
/home/gameservers/users/user873/lib/
/home/gameservers/users/user873/var/
/home/gameservers/users/user873/usr/
/home/gameservers/users/user873/home/
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast