We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 635aa34 commit be3a7bdCopy full SHA for be3a7bd
install/deb/filemanager/filegator/configuration.php
@@ -27,9 +27,11 @@
27
28
if (!isset($_SESSION['SFTP_PORT'])) {
29
exec("sudo /usr/local/hestia/bin/v-list-sys-sshd-port json", $output, $result);
30
- if ($output) {
31
- $port=json_decode(implode('', $output));
+ $port=json_decode(implode('', $output));
+ if ( is_numeric($port[0]) && $port[0] > 0 ){
32
$_SESSION['SFTP_PORT'] = $port[0];
33
+ } else if ( preg_match('/^\s*Port\s+(\d+)$/im', file_get_contents('/etc/ssh/sshd_config'), $matches) ) {
34
+ $_SESSION['SFTP_PORT'] = $matches[1] ?? 22;
35
} else {
36
$_SESSION['SFTP_PORT'] = 22;
37
}
0 commit comments