Skip to content

Commit 8068539

Browse files
authored
chmod o+x .ssh when creating hst-filemanager-key (hestiacp#2755)
i habitually chmod my .ssh folders to 0700, that broke filemanager, wasted some time figuring out what the problem was, this will hopefully save someone else from having to figure out that the filemanager requires a minimum of o+x (interestingly it doesn't require o+r so i left it out)
1 parent 3f7f648 commit 8068539

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

install/deb/filemanager/filegator/configuration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
# Create filemanager sftp key if missing and trash it after 30 min
2626
if (! file_exists('/home/'.basename($v_user).'/.ssh/hst-filemanager-key')) {
2727
exec("sudo /usr/local/hestia/bin/v-add-user-sftp-key " . escapeshellarg(basename($v_user)) . " 30", $output, $return_var);
28+
// filemanager also requires .ssh chmod o+x ... hopefully we can improve it to g+x or u+x someday
29+
// current minimum for filemanager: chmod 0701 .ssh
30+
shell_exec("sudo chmod o+x " . escapeshellarg('/home/' . basename($v_user) . '/.ssh'));
2831
}
2932

3033
if (!isset($_SESSION['SFTP_PORT'])) {

0 commit comments

Comments
 (0)