diff --git a/server/plugins-available/shelluser_base_plugin.inc.php b/server/plugins-available/shelluser_base_plugin.inc.php
index ca69b5f5ab2bafd28ebf8e07ee85ac9aa93fde64..35f790ea56c25ba7526277fa39ee909bc2f1807b 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';