Yes, it seems the ssh users are jailed in /var/www/vhosts/<domain>
Can I somehow
yum install sudo
with all dependencies into the "jail"?
Main Topics
Browse All TopicsHi,
I try to make sudo available to an ssh user I created through Plesk on CentOS 5.2
So far
- I installed sudo, as it was not available
> yum sudo install
- Added the user I wanted to the wheel group
> usermod -a -G wheel theuser
- Uncommented %wheel in /etc/sudoers
But noticed sudo is not available if I log in as that user.
I noticed /var/www/vhosts/<domain>/u
but then shared libraries started to be missing:
"sudo: error while loading shared libraries: libpam.so.0: cannot open shared object file: No such file or directory"
So I figured I could go through this and copy one missing library after the other from it's original location to the respective /var/www/vhosts/<domain> folder, but I assume there is a better way to do so.
Thank you
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You can use rpminfo to get the sudo package file listing.
You can use the list to copy (cpio); however, the user can not be ssh jailed in /var/www/vhost/<domain> or you would need to perform the above for each domain. You would not need to copy, but you would need to make hard links (ln) You will likely still run into missing shared librarries. use ldd /usr/bin/sudo will give you a list of shared libraries that sudo relies on.
The issue is sudo may give them more access to the entire system not limited to the jailed environment.
I spent quite some time yesterday trying to make sudo available to the jailed domain users. This would be necessary in order to use svn from those accounts.
Installing sudo itself was not a problem (yum install sudo) but making it available to not only the root user (which is the purpose of the command sudo) seems to be a bit more tricky.
From what I figured out the domain users are "jailed" in their respective directories /var/www/vhosts/<domain> which is their root directory. The result is that sudo, all required configuration files and dependencies (libraries) etc must be available within /var/www/vhosts/<domain>
So far I have
- created the folder /usr/bin in the jail
> mkdir /var/www/vhosts/<domain>/usr
- I then copied /usr/bin/sudo to /var/www/vhosts/<domain>/usr
- To copy all dependent libraries I used the command ldd to receive a list of all dependent libraries (ldd /usr/bin/sudo)
I have used the following line to copy the dependent libraries
> ldd /usr/bin/sudo | awk '{ print $3; }' | sed 's/\(\/.*\/\(.*\)\)/\1 \/var\/www\/vhosts\/<domain
Which prompts for every dependency to copy and not overwrite libraries that are already available with cp -i
- Then I started to copy required resources but did not get far.
-- I copied /etc/sudoers into /var/www/vhosts/<domain>/etc
-- I also copied /etc/pam.d/sudo to
/var/www/vhosts/<domain>/etc
But then got stuck with the following error message when executing from the domain user account:
> sudo svn help
sudo: pam_authenticate: Module is unknown
I was hoping there is an easier way to install sudo (or other commands we will need) in the jail, like some sort of
> yum --jail=/var/www/vhosts/liv
Or another script that might take care of that, but was not able to find anything.
Sorry for the confusion.
The (web) application will be deployed as an svn checkout on the server, so actually I just need the svn command, not an svn server for the domain user.
Also some of the configuration files require root access to be edited.
I would like to try to avoid giving the domain user root access by default. So I figured sudo would be a good compromise.
Does that make sense?
Business Accounts
Answer for Membership
by: arnoldPosted on 2008-11-18 at 19:26:48ID: 22991243
Not sure whether you have jailed the ssh in /var/www/vhosts, but you would need to compile and install sudo in the same hierarchy.
i.e. if you have /var/www/vhosts as the "jailed /",
you need to install /var/www/vhosts/lib /var/www/vhosts/bin and /var/www/vhosts/etc.
when compiling sudo use --prefix="/var/www/vhosts"