I’ve just switched from VestaCP to HestiaCP and I want to say great job – this panel is much better! I’ve already managed to install PHP 5.6 using your guides with the command: v-add-web-php 5.6
It works perfectly, so thank you for that.
The reason I need this control panel (previously using VestaCP) is because I run an old game panel called BrightGamePanel maybe someone here is familiar with it. It’s used to manage game servers running on other virtual machines.
BrightGamePanel requires adding a “BOX” by entering SSH credentials for remote connection. However, unlike with VestaCP, it seems that SSH connections from PHP are not working in HestiaCP. The panel always returns “unable to connect to host”. I’ve confirmed the credentials are correct, but even when I try using SSH from the command line (from the web server), the access fails.
Is SSH access perhaps blocked entirely or just from PHP? If so, how can I enable it?
You should check what’s the error in web log /var/log/apache2/domains/YourDomain.error.log
Maybe that panel is trying to use some disabled functions like exec, system, shell_exec, proc_open, popen, etc. If that’s true, then you should enable them for the PHP version you are using but first you need to know what the error is.
I’m actually not using Apache2 – I’m running Nginx + PHP-FPM only. I checked the script used by BrightGamePanel to add the boxes, and I found the part of the code responsible for the SSH connection. Maybe this helps understand the issue:
//Prevent direct access
if (!defined('LICENSE')) {
exit('Access Denied');
}
if (!class_exists('Net_SSH2')) {
if (file_exists('../libs/phpseclib/SSH2.php')) {
// Admin Side
require_once("../libs/phpseclib/SSH2.php");
} else {
// Client Side
require_once("./libs/phpseclib/SSH2.php");
}
}
/**
* Establish a SSH2 connection using PHPSECLIB
*
* @return object (ssh obj) OR string (err)
*/
function newNetSSH2($ip, $sshport = 22, $login, $password)
{
$ssh = new Net_SSH2($ip, $sshport);
if (!$ssh->login($login, $password)) {
$socket = @fsockopen($ip, $sshport, $errno, $errstr, 5);
if ($socket == FALSE) {
$debug = "Unable to connect to $ip on port $sshport : $errstr ( Errno: $errno )";
return $debug;
}
return 'Unable to connect to box with SSH';
}
return $ssh;
}
The SSH2.php is available here is too long: bgpanel/libs/phpseclib/SSH2.php at master · BrightGamePanel/bgpanel
It looks like the panel is using phpseclib to make the SSH connection, so it’s not relying on functions like exec() or shell_exec(). Do you know if there’s any configuration in HestiaCP or PHP-FPM that might block this kind of connection?
Let me know if there’s anything else I should check. Thanks again!