@@ -58,29 +58,29 @@ if [ -n "$user_str" ]; then
5858fi
5959
6060if [ ! -d " $chroot " ]; then
61- add_chroot_jail " $user "
62-
63- # Add user to the ssh-jailed group to allow jailed ssh
64- # This needs to be done first to make sure these groups are made available in the jail
65- usermod -a -G ssh-jailed " $user "
66-
67- # Installing shell files into the user chroot directory
68- # - IMPORTANT - MODIFY THE FOLLOWING LINES AND THE FILE jk_init.ini ACCORDING TO YOUR SYSTEM AND YOUR PREFERENCES
69- /sbin/jk_init -f -j " $chroot " extendedshell netutils ssh sftp scp git php php5_6 php7_0 php7_1 php7_2 php7_3 php7_4 php8_0 php8_1 php8_2 > /dev/null 2>&1
70- /sbin/jk_cp -f -j " $chroot " /bin/id > /dev/null 2>&1
71-
72- # Jailing user to make sure passwd and groups are set correctly within the jail.
73- # This command also does a little too much by changing the users homedir and
74- # shell in /etc/passwd. The next commands reverts those changes for compatibility
75- # with hestia.
76- /sbin/jk_jailuser -n -s " $shell_path " -j " $chroot " " $user "
77-
78- # Reset home directory and shell again for hestiacp because jailkit changes these.
79- # Normally these are needed to redirect the ssh user to it's chroot but because we
80- # use a custom sshd_config to redirect the user to it's chroot we don't need it to be
81- # changed in /etc/passwd for the user.
82- usermod -d " /home/$user " " $user " > /dev/null 2>&1
83- usermod -s " $shell_path " " $user " > /dev/null 2>&1
61+ add_chroot_jail " $user "
62+
63+ # Add user to the ssh-jailed group to allow jailed ssh
64+ # This needs to be done first to make sure these groups are made available in the jail
65+ usermod -a -G ssh-jailed " $user "
66+
67+ # Installing shell files into the user chroot directory
68+ # - IMPORTANT - MODIFY THE FOLLOWING LINES AND THE FILE jk_init.ini ACCORDING TO YOUR SYSTEM AND YOUR PREFERENCES
69+ /sbin/jk_init -f -j " $chroot " extendedshell netutils ssh sftp scp git php php5_6 php7_0 php7_1 php7_2 php7_3 php7_4 php8_0 php8_1 php8_2 > /dev/null 2>&1
70+ /sbin/jk_cp -f -j " $chroot " /bin/id > /dev/null 2>&1
71+
72+ # Jailing user to make sure passwd and groups are set correctly within the jail.
73+ # This command also does a little too much by changing the users homedir and
74+ # shell in /etc/passwd. The next commands reverts those changes for compatibility
75+ # with hestia.
76+ /sbin/jk_jailuser -n -s " $shell_path " -j " $chroot " " $user "
77+
78+ # Reset home directory and shell again for hestiacp because jailkit changes these.
79+ # Normally these are needed to redirect the ssh user to it's chroot but because we
80+ # use a custom sshd_config to redirect the user to it's chroot we don't need it to be
81+ # changed in /etc/passwd for the user.
82+ usermod -d " /home/$user " " $user " > /dev/null 2>&1
83+ usermod -s " $shell_path " " $user " > /dev/null 2>&1
8484
8585else
8686 /sbin/jk_update -f -j " $chroot " > /dev/null 2>&1
0 commit comments