Skip to content

Commit 5c04a83

Browse files
authored
Fix sftp homedir staring in /home and not /home/[user] (hestiacp#4862)
1 parent 9187d54 commit 5c04a83

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

bin/v-add-sys-sftp-jail

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if [ -z "$sftp_i" ]; then
5151
echo " ChrootDirectory /srv/jail/%u" >> $config
5252
echo " X11Forwarding no" >> $config
5353
echo " AllowTCPForwarding no" >> $config
54-
echo " ForceCommand internal-sftp -d /home" >> $config
54+
echo " ForceCommand internal-sftp -d /home/%u" >> $config
5555
restart='yes'
5656
fi
5757

install/upgrade/versions/1.9.3.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ if [ -x /usr/sbin/jailbash ]; then
3333
$HESTIA/bin/v-add-sys-ssh-jail
3434
fi
3535

36+
# Fix sftp not starting in /home/[user]
37+
sed -i -E "s/ForceCommand internal-sftp -d \/home$/ForceCommand internal-sftp -d \/home\/%u/g" /etc/ssh/sshd_config
38+
3639
# Check if file exists
3740
if [ -f "/etc/cron.d/hestiaweb" ]; then
3841
# Just remove it

0 commit comments

Comments
 (0)