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 285f9b0 commit 6be496bCopy full SHA for 6be496b
install/deb/filemanager/filegator/configuration.php
@@ -21,9 +21,17 @@
21
exec ("sudo /usr/local/hestia/bin/v-add-user-sftp-key " . escapeshellarg(basename($v_user)) . " 30", $output, $return_var);
22
}
23
24
+ if ( !isset($_SESSION['SFTP_PORT']) ) {
25
+ if( preg_match('/^\s*Port\s+(\d+)$/im', file_get_contents('/etc/ssh/sshd_config'), $matches) ) {
26
+ $_SESSION['SFTP_PORT'] = $matches[1] ?? 22;
27
+ } else {
28
+ $_SESSION['SFTP_PORT'] = 22;
29
+ }
30
31
+
32
return new \League\Flysystem\Sftp\SftpAdapter([
33
'host' => '127.0.0.1',
- 'port' => 22,
34
+ 'port' => intval($_SESSION['SFTP_PORT']),
35
'username' => basename($v_user),
36
'privateKey' => '/home/'.basename($v_user).'/.ssh/hst-filemanager-key',
37
'root' => '/',
0 commit comments