Run Java in a chrooted jail

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm on a CentOS 6.5 machine with Plesk Panel which I used to create a chrooted environment for a user who can access it via ssh.
I managed to let him use some basic non chroot standard command like chmod or ps.
NOW what I need to do to let him use java to run his own compiled jar inside his new shiny jail?










share|improve this question
























  • The complete Java runtime needs also to be located in the chroot path.

    – user55518
    Mar 5 '14 at 22:17












  • and it's possible or just crazy stuff to do? Can I also install a dedicated Java machine just inside the chroot dir or...?

    – Leonardo Gandini
    Mar 5 '14 at 22:53











  • it is possible and not easy.

    – user55518
    Mar 5 '14 at 22:56

















1















I'm on a CentOS 6.5 machine with Plesk Panel which I used to create a chrooted environment for a user who can access it via ssh.
I managed to let him use some basic non chroot standard command like chmod or ps.
NOW what I need to do to let him use java to run his own compiled jar inside his new shiny jail?










share|improve this question
























  • The complete Java runtime needs also to be located in the chroot path.

    – user55518
    Mar 5 '14 at 22:17












  • and it's possible or just crazy stuff to do? Can I also install a dedicated Java machine just inside the chroot dir or...?

    – Leonardo Gandini
    Mar 5 '14 at 22:53











  • it is possible and not easy.

    – user55518
    Mar 5 '14 at 22:56













1












1








1








I'm on a CentOS 6.5 machine with Plesk Panel which I used to create a chrooted environment for a user who can access it via ssh.
I managed to let him use some basic non chroot standard command like chmod or ps.
NOW what I need to do to let him use java to run his own compiled jar inside his new shiny jail?










share|improve this question
















I'm on a CentOS 6.5 machine with Plesk Panel which I used to create a chrooted environment for a user who can access it via ssh.
I managed to let him use some basic non chroot standard command like chmod or ps.
NOW what I need to do to let him use java to run his own compiled jar inside his new shiny jail?







linux centos java chroot plesk






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 18 at 3:07









Rui F Ribeiro

42.1k1484142




42.1k1484142










asked Mar 5 '14 at 21:56









Leonardo GandiniLeonardo Gandini

84




84












  • The complete Java runtime needs also to be located in the chroot path.

    – user55518
    Mar 5 '14 at 22:17












  • and it's possible or just crazy stuff to do? Can I also install a dedicated Java machine just inside the chroot dir or...?

    – Leonardo Gandini
    Mar 5 '14 at 22:53











  • it is possible and not easy.

    – user55518
    Mar 5 '14 at 22:56

















  • The complete Java runtime needs also to be located in the chroot path.

    – user55518
    Mar 5 '14 at 22:17












  • and it's possible or just crazy stuff to do? Can I also install a dedicated Java machine just inside the chroot dir or...?

    – Leonardo Gandini
    Mar 5 '14 at 22:53











  • it is possible and not easy.

    – user55518
    Mar 5 '14 at 22:56
















The complete Java runtime needs also to be located in the chroot path.

– user55518
Mar 5 '14 at 22:17






The complete Java runtime needs also to be located in the chroot path.

– user55518
Mar 5 '14 at 22:17














and it's possible or just crazy stuff to do? Can I also install a dedicated Java machine just inside the chroot dir or...?

– Leonardo Gandini
Mar 5 '14 at 22:53





and it's possible or just crazy stuff to do? Can I also install a dedicated Java machine just inside the chroot dir or...?

– Leonardo Gandini
Mar 5 '14 at 22:53













it is possible and not easy.

– user55518
Mar 5 '14 at 22:56





it is possible and not easy.

– user55518
Mar 5 '14 at 22:56










1 Answer
1






active

oldest

votes


















0














Do not use chroot(). Use OpenVZ. OpenVZ is chroot on steroids: Not only does OpenVZ give a container its own root directory, it also gives a container its own init() process, its own process list, its own IP, its own memory and disk space quota, etc.



  • http://openvz.org/Quick_installation

  • Once OpenVZ is installed, go to /vz/template/cache and download a CentOS template: wget http://ftp.openvz.org/template/precreated/centos-6-x86-devel.tar.gz

  • Now: vzctl create 100 --ostemplate centos-6-x86-devel

  • Then: vzctl set 100 --ipadd 192.168.1.99 --save Change 192.168.1.99 to a static IP that will work on your network


  • vzctl set 100 --nameserver 8.8.8.8 --save Use one of Google's free DNS servers

  • vzctl start 100

  • vzctl enter 100

  • At the root prompt in the new container: yum -y update

  • Install Java in the new container: yum install java-1.6.0-openjdk-devel.i686

  • Make a user and password/SSH key for the container so your buddy can play with Java: adduser buddy followed by passwd buddy (replace "buddy" with any name you wish to use here)

  • Make sure the container is running sshd so he can SSH in to the container.

  • Make sure there is a way for him to get in to your computer.

The big gotcha here is that you will need to have full access to the machine in question and the computer will need to be on a network where you can assign a different IP for each container. Another gotcha is that the container will use about a gig of hard disk space -- more if your buddy makes a lot of files in the container. If the machine in question is a machine in a hosting environment, make sure the AUP you have allows you to run OpenVZ and other virtualization technologies (some hosting providers do not permit this).






share|improve this answer























  • This sounds like a solution ;) Many thanks!!

    – Leonardo Gandini
    Mar 6 '14 at 7:20











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f118316%2frun-java-in-a-chrooted-jail%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Do not use chroot(). Use OpenVZ. OpenVZ is chroot on steroids: Not only does OpenVZ give a container its own root directory, it also gives a container its own init() process, its own process list, its own IP, its own memory and disk space quota, etc.



  • http://openvz.org/Quick_installation

  • Once OpenVZ is installed, go to /vz/template/cache and download a CentOS template: wget http://ftp.openvz.org/template/precreated/centos-6-x86-devel.tar.gz

  • Now: vzctl create 100 --ostemplate centos-6-x86-devel

  • Then: vzctl set 100 --ipadd 192.168.1.99 --save Change 192.168.1.99 to a static IP that will work on your network


  • vzctl set 100 --nameserver 8.8.8.8 --save Use one of Google's free DNS servers

  • vzctl start 100

  • vzctl enter 100

  • At the root prompt in the new container: yum -y update

  • Install Java in the new container: yum install java-1.6.0-openjdk-devel.i686

  • Make a user and password/SSH key for the container so your buddy can play with Java: adduser buddy followed by passwd buddy (replace "buddy" with any name you wish to use here)

  • Make sure the container is running sshd so he can SSH in to the container.

  • Make sure there is a way for him to get in to your computer.

The big gotcha here is that you will need to have full access to the machine in question and the computer will need to be on a network where you can assign a different IP for each container. Another gotcha is that the container will use about a gig of hard disk space -- more if your buddy makes a lot of files in the container. If the machine in question is a machine in a hosting environment, make sure the AUP you have allows you to run OpenVZ and other virtualization technologies (some hosting providers do not permit this).






share|improve this answer























  • This sounds like a solution ;) Many thanks!!

    – Leonardo Gandini
    Mar 6 '14 at 7:20















0














Do not use chroot(). Use OpenVZ. OpenVZ is chroot on steroids: Not only does OpenVZ give a container its own root directory, it also gives a container its own init() process, its own process list, its own IP, its own memory and disk space quota, etc.



  • http://openvz.org/Quick_installation

  • Once OpenVZ is installed, go to /vz/template/cache and download a CentOS template: wget http://ftp.openvz.org/template/precreated/centos-6-x86-devel.tar.gz

  • Now: vzctl create 100 --ostemplate centos-6-x86-devel

  • Then: vzctl set 100 --ipadd 192.168.1.99 --save Change 192.168.1.99 to a static IP that will work on your network


  • vzctl set 100 --nameserver 8.8.8.8 --save Use one of Google's free DNS servers

  • vzctl start 100

  • vzctl enter 100

  • At the root prompt in the new container: yum -y update

  • Install Java in the new container: yum install java-1.6.0-openjdk-devel.i686

  • Make a user and password/SSH key for the container so your buddy can play with Java: adduser buddy followed by passwd buddy (replace "buddy" with any name you wish to use here)

  • Make sure the container is running sshd so he can SSH in to the container.

  • Make sure there is a way for him to get in to your computer.

The big gotcha here is that you will need to have full access to the machine in question and the computer will need to be on a network where you can assign a different IP for each container. Another gotcha is that the container will use about a gig of hard disk space -- more if your buddy makes a lot of files in the container. If the machine in question is a machine in a hosting environment, make sure the AUP you have allows you to run OpenVZ and other virtualization technologies (some hosting providers do not permit this).






share|improve this answer























  • This sounds like a solution ;) Many thanks!!

    – Leonardo Gandini
    Mar 6 '14 at 7:20













0












0








0







Do not use chroot(). Use OpenVZ. OpenVZ is chroot on steroids: Not only does OpenVZ give a container its own root directory, it also gives a container its own init() process, its own process list, its own IP, its own memory and disk space quota, etc.



  • http://openvz.org/Quick_installation

  • Once OpenVZ is installed, go to /vz/template/cache and download a CentOS template: wget http://ftp.openvz.org/template/precreated/centos-6-x86-devel.tar.gz

  • Now: vzctl create 100 --ostemplate centos-6-x86-devel

  • Then: vzctl set 100 --ipadd 192.168.1.99 --save Change 192.168.1.99 to a static IP that will work on your network


  • vzctl set 100 --nameserver 8.8.8.8 --save Use one of Google's free DNS servers

  • vzctl start 100

  • vzctl enter 100

  • At the root prompt in the new container: yum -y update

  • Install Java in the new container: yum install java-1.6.0-openjdk-devel.i686

  • Make a user and password/SSH key for the container so your buddy can play with Java: adduser buddy followed by passwd buddy (replace "buddy" with any name you wish to use here)

  • Make sure the container is running sshd so he can SSH in to the container.

  • Make sure there is a way for him to get in to your computer.

The big gotcha here is that you will need to have full access to the machine in question and the computer will need to be on a network where you can assign a different IP for each container. Another gotcha is that the container will use about a gig of hard disk space -- more if your buddy makes a lot of files in the container. If the machine in question is a machine in a hosting environment, make sure the AUP you have allows you to run OpenVZ and other virtualization technologies (some hosting providers do not permit this).






share|improve this answer













Do not use chroot(). Use OpenVZ. OpenVZ is chroot on steroids: Not only does OpenVZ give a container its own root directory, it also gives a container its own init() process, its own process list, its own IP, its own memory and disk space quota, etc.



  • http://openvz.org/Quick_installation

  • Once OpenVZ is installed, go to /vz/template/cache and download a CentOS template: wget http://ftp.openvz.org/template/precreated/centos-6-x86-devel.tar.gz

  • Now: vzctl create 100 --ostemplate centos-6-x86-devel

  • Then: vzctl set 100 --ipadd 192.168.1.99 --save Change 192.168.1.99 to a static IP that will work on your network


  • vzctl set 100 --nameserver 8.8.8.8 --save Use one of Google's free DNS servers

  • vzctl start 100

  • vzctl enter 100

  • At the root prompt in the new container: yum -y update

  • Install Java in the new container: yum install java-1.6.0-openjdk-devel.i686

  • Make a user and password/SSH key for the container so your buddy can play with Java: adduser buddy followed by passwd buddy (replace "buddy" with any name you wish to use here)

  • Make sure the container is running sshd so he can SSH in to the container.

  • Make sure there is a way for him to get in to your computer.

The big gotcha here is that you will need to have full access to the machine in question and the computer will need to be on a network where you can assign a different IP for each container. Another gotcha is that the container will use about a gig of hard disk space -- more if your buddy makes a lot of files in the container. If the machine in question is a machine in a hosting environment, make sure the AUP you have allows you to run OpenVZ and other virtualization technologies (some hosting providers do not permit this).







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 6 '14 at 3:46









samiamsamiam

2,496813




2,496813












  • This sounds like a solution ;) Many thanks!!

    – Leonardo Gandini
    Mar 6 '14 at 7:20

















  • This sounds like a solution ;) Many thanks!!

    – Leonardo Gandini
    Mar 6 '14 at 7:20
















This sounds like a solution ;) Many thanks!!

– Leonardo Gandini
Mar 6 '14 at 7:20





This sounds like a solution ;) Many thanks!!

– Leonardo Gandini
Mar 6 '14 at 7:20

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f118316%2frun-java-in-a-chrooted-jail%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?