Innovative Open source WEB technologies for everyone

ADD GIT TO PLESK ONYX 17.8.11 CHROOT ON DEBIAN JESSIE 8.11

ADD GIT TO PLESK ONYX 17.8.11 CHROOT ON DEBIAN JESSIE 8.11

A truly common problem that affects users in their hosting environments is the lack of popular commands within a chroot environment.
Since you do not want your users to have root access to your server but still want them to be able to execute shell commands, it makes sense to set up a chroot jail. With this setup, you secure your server from the user, as they cannot damage any directory tree other than the one assigned to them. It should be noted, however, that it is possible to escape a chroot jail, but it still provides more than adequate protection against accidental damage. Therefore, you should use it when you trust your users.
After setting up Plesk and enabling chroot for a subscriber, you will quickly notice that many programs such as Git are not available. This is mainly due to the fact that many programs require access to devices and services that are generally not available, as they fall outside the scope of the chroot environment. Adding them is not that difficult.
For example, common requests include ssh, tty, urandom, and so on. To make this easier, Plesk created a tool called update_chroot.sh, which you can download from here. With the following commands, you can add the above components.
Download the tool to /home as root and then run:
				
					 
~/update_chroot.sh --add ssh
~/update_chroot.sh --devices tty
~/update_chroot.sh --devices /dev/urandom
 
				
			
In this article, we focus on Git. The following commands allow us to add it:
				
					mkdir -p /var/www/vhosts/chroot/usr/share/git-core/templates
cp -raL /usr/share/git-core/templates/ /var/www/vhosts/chroot/usr
/share/git-core/templates
~/update_chroot.sh --add /usr/bin/tr
~/update_chroot.sh --add /usr/bin/git
~/update_chroot.sh --add /usr/bin/dirname /usr/bin/wc /usr/bin/perl
 /usr/bin/tput /usr/bin/basename
~/update_chroot.sh --add /usr/bin/git*
~/update_chroot.sh --add /usr/lib/git-core/*
cp -raL /usr/lib/git-core/* /var/www/vhosts/chroot/usr/lib/git-core/
				
			
After adding all the required tools, you will need to update the chroot environment. For example:
				
					~/update_chroot.sh --apply ioweb.gr
				
			
If you cannot find one of the commands, try using ‘which ‘, for example ‘which tr’ or ‘which basename’.
Close Popup

We use cookies to give you the best online experience. By agreeing you accept the use of cookies in accordance with our cookie policy.

Close Popup
Privacy Settings saved!
Privacy Settings

When you visit any web site, it may store or retrieve information on your browser, mostly in the form of cookies. Control your personal Cookie Services here.

This cookies are necessary for the operation of the website and cannot be disabled

Wordpress
These cookies are essential for the operation of the website and cannot be deactivated

Decline all Services
Save
Accept all Services
Open Privacy settings
×