• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

/bin/bash (chrooted) no longer available and chrooted users no longer able to login

P

pixoul

Guest
I've got a bit of weirdness that I can't figure out. I tried to login to a chrooted account on my server via SSH this evening (Plesk 7.5 Reloaded on RHEL ES 4) and got the following error. Username replaced with xxxx:

Code:
yump:~ sean$ slogin [email][email protected][/email]
[email][email protected][/email]'s password: 
execv("/bin/bash") failed
system error: Permission denied
Connection to colo1.pixoul.com closed.

I logged in as root and checked out /etc/passwd; everything looks normal:

Code:
xxxx:x:xxxx:xxxx::/var/www/vhosts/pixoul.com:/usr/local/psa/bin/chrootsh

But in the Physical hosting setup page /bin/bash (chrooted) is no longer an option! So none of my chrooted users can login (see attached image).

nochroot.png


Here's a log excerpt:

Code:
==> messages <==
Mar  4 01:15:50 colo1 sshd(pam_unix)[22371]: session opened for user pixoulcom by (uid=0)
Mar  4 06:15:50 colo1 plesk-chrootsh[22373]: execv("/bin/bash") failed
Mar  4 06:15:50 colo1 plesk-chrootsh[22373]: system error: Permission denied

==> secure <==
Mar  4 01:15:50 colo1 sshd[22369]: Accepted password for xxxx from ::ffff:66.92.69.252 port 63146 ssh2
Mar  4 01:15:50 colo1 sshd[22371]: Setting tty modes failed: Invalid argument

==> messages <==
Mar  4 01:15:50 colo1 sshd(pam_unix)[22371]: session closed for user xxxx

Any ideas? :(
 
I seem to have found my problem. Somehow all the files in the following directories lost their execute bit:

Code:
/var/www/vhosts/*/bin
/var/www/vhosts/*/lib
/var/www/vhosts/*/usr/libexec

I solved the problem by running:

Code:
cd /var/www/vhosts/
for dir in *; do chmod +x $dir/bin/* $dir/lib/* $dir/usr/libexec/openssh/sftp-server; done

Do you guys know of any reason why every single chroot directory would have lost its execute bit? Is there some rogue cleanup script that runs that may have fragged thing? :(
 
Pixoul, did this make your "/bin/bash (chrooted)" re-appear?

I am having the same problem under Plesk 8.1.0.
 
Back
Top