I have a small software company. I recently moved my website to a VPS server at asmallorange.com. They use CPanel/WHM exclusively. I have spent the last few days rebuilding support for PHP 5 and Apache 2.2, installing all of the databases, stored procedures, and site files, and getting all of the server settings just right. I did all of this using only WHM and shell access. In other words, I did not setup any CPanel accounts. One of the first support agents I talked to at asmallorange.com suggested everything I needed could be done using only WHM and sure enough that turned out to be true... and simpler. The last missing piece of the setup is FTP user accounts for my beta testing team. They log in to grab new software builds as they become available for testing. On the original server setup (before the move to A.S.O.), each tester was chroot'ed into his/her unique ftp home folder, so that they -- or anyone else who sneaks in under one of their usernames -- couldn't see anything outside of that folder. It worked nicely, but was done using a completely different mechanism in the other host's control panel (not CPanel/WHM). When trying to set this up today in WHM/shell, nothing I tried worked... I tried the "/./" trick, tried both pure-ftp and proftp, and tried adding -A and --chrooteveryone to the launch flags of pure-ftp. Nothing has worked so far. The jailshell checkbox under "Tweaks" in WHM doesn't do anything and has been checked this whole time (I think this only applies to CPanel accounts, of which I have none).
When I contacted support again a few minutes ago, the guy -- a different one this time -- said that I cannot run a web server with just WHM and no CPanel accounts. I don't see why not. Everything else I have needed to do has been done already and is working great, and ALL of it was done in WHM/shell.
So, instead of debating him, I thought I'd ask in here... how do I get chroot working for SFTP logins... while still running a WHM-only setup?
Note that when I say I tried -A and --chrooteveryone, I'm not sure that I figured out exactly the right place to squeeze them in. CPanel, as you know, has all kinds of wrappers around the typical config files and launch mechanisms of all of the services it supports. The same is true of pure-ftp. The closest I got was /scripts/restartsrv_ftpserver...
After this line...
( $processowner, $service, $iscript, $manualstart, $servicebin, $serviceflags, $disabled ) = servicefixup( $system, $service );
I tried adding --chrooteveryone to the $serviceflags variable, before it's actually used:
$serviceflags = $serviceflags . " --chrooteveryone";
When I print this out just afterwards, I can see the printed output inside WHM when I restart the FTP service in its UI:
print "serviceflags = $serviceflags\n";
When I restart ftp inside WHM, I can see:
serviceflags = --chrooteveryone
... but that doesn't help.
Maybe it needs to be an array instead of a string or something like that.
Or maybe "$serviceflags" is some other set of flags. It's hard to tell since CPanel adds 100 levels of abstraction away from the core startup mechanism.
There is also a pure-ftp config file, but it appears as though it's not being used.
Anyone know how I can get this working?
Thanks.
Philip



LinkBack URL
About LinkBacks
Reply With Quote










