- Plesk for Linux
/bin/bash (chrooted) is selected as a shell in the Domains > example.com > Access to the server over SSH
The restriction to the
/var/www/vhosts/example.comis active in the SSH session:
# ssh [email protected]
bash-4.2$ echo -n 'SFTP restrictions '; [[ -e /httpdocs ]] && echo 'active' || echo 'inactive'
SFTP restrictions active
The restriction is not active in the SFTP (it is possible to traverse to the real root):
Subsystem sftpis set to the
internal-sftpin the SSHD configuration:
# grep sftp /etc/ssh/sshd_config | grep -v '^#'
Subsystem sftp internal-sftp
internal-sftp is not compatible with the Plesk chrooted shell configuration for SFTP.
Switch back to the default STFP subsystem:
Connect to the server via SSH
Comment out currently existing
Note: A backup will be placed to the
# sed -i.bkp '/sftp/s/^/#/g' /etc/ssh/sshd_config
Add the default binary path to the configuration:
# echo 'Subsystem sftp /usr/libexec/openssh/sftp-server' >> /etc/ssh/sshd_config
Check the SSHD configuration:
# sshd -t
Note: In case no output was returned, the configuration is correct.
Reload the SSHD to apply new configuration:
# service sshd reload
Note: In case the connection fails with
Received unexpected end-of-file from SFTP server after the solution was applied, rebuild chroot template.