From 3fb9be68159f94f4fe9f6fac579b31b5533b6dc7 Mon Sep 17 00:00:00 2001 From: Till Brehm <tbrehm@ispconfig.org> Date: Wed, 3 Jun 2015 18:44:01 +0200 Subject: [PATCH] Fix for FS#3857 .ssh key directory problem. --- server/plugins-available/shelluser_base_plugin.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/plugins-available/shelluser_base_plugin.inc.php b/server/plugins-available/shelluser_base_plugin.inc.php index ca69b5f5ab..35f790ea56 100755 --- a/server/plugins-available/shelluser_base_plugin.inc.php +++ b/server/plugins-available/shelluser_base_plugin.inc.php @@ -402,6 +402,12 @@ class shelluser_base_plugin { } $sshrsa = trim($sshrsa); $usrdir = escapeshellcmd($this->data['new']['dir']); + //* Home directory of the new shell user + if($this->data['new']['chroot'] == 'jailkit') { + $usrdir = escapeshellcmd($this->data['new']['dir']); + } else { + $usrdir = escapeshellcmd($this->data['new']['dir'].'/home/'.$data['new']['username']); + } $sshdir = $usrdir.'/.ssh'; $sshkeys= $usrdir.'/.ssh/authorized_keys'; -- GitLab