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 5cb8249 commit d11806aCopy full SHA for d11806a
install/deb/filemanager/filegator/configuration.php
@@ -34,12 +34,20 @@
34
}
35
36
37
+ preg_match('/(Hestia SFTP Chroot\nMatch User)(.*)/i', file_get_contents('/etc/ssh/sshd_config'), $matches);
38
+ $user_list = explode(',', $matches[2]);
39
+ if(in_array($v_user,$user_list)){
40
+ $root = '/';
41
+ }else{
42
+ $root = '/home/'.$v_user;
43
+ }
44
+
45
return new \League\Flysystem\Sftp\SftpAdapter([
46
'host' => '127.0.0.1',
47
'port' => intval($_SESSION['SFTP_PORT']),
48
'username' => basename($v_user),
49
'privateKey' => '/home/'.basename($v_user).'/.ssh/hst-filemanager-key',
- 'root' => '/',
50
+ 'root' => $root,
51
'timeout' => 10,
52
'directoryPerm' => 0755,
53
]);
0 commit comments