Sometimes when you upgrade your Plesk in a Linux Server, you may break the Chrooted SFTP. This can happen mostly when the configuration file is modified outside of the Linux server.

At the time of the Plesk update, the Linux system detects the special characters (^M) and processes it as the carriage return and this break the Chrooted SFTP.

You may find the installation log in Plesk (eg: /var/log/plesk/install/plesk_17.5.3_installation.log), with error log as follows:
=====
/lib64/libfreebl3.so’ -> ‘/var/www/vhosts/chroot//usr/lib64/libfreebl3.so’
which: no unrar in (/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin)
Trying to install sftp-server binary into chroot environment… ‘/usr/libexec/openssh/sftp-server’ -> ‘/var/www/vhosts/chroot/usr/libexec/openssh/sftp-server’
done
‘/lib64/libcrypto.so.10’ -> ‘/var/www/vhosts/chroot//usr/lib64/libcrypto.so.10’
‘/lib64/libdl.so.2’ -> ‘/var/www/vhosts/chroot//usr/lib64/libdl.so.2’
‘/lib64/libldap-2.4.so.2’ -> ‘/var/www/vhosts/chroot//usr/lib64/libldap-2.4.so.2’
=====

While checking for SSHD configuration file in /etc/ssh/sshd_config, it may contain some special characters.

====
# cat /etc/ssh/sshd_config | grep sftp-server

Subsystem sftp /usr/libexec/openssh/sftp-server^M$
====

The errors can be fixed by removing the special character.

The following steps can be taken to fix a broken Chrooted SFTP after a Plesk Upgrade.
1. Login to the server via SSH;

2. Take a backup of the SSHD configuration file using the following command.

====
# cp -p etc/ssh/sshd_config /etc/ssh/sshd_config.backup
====

3. Remove the windows special characters and save the file using “vi” command.

====
# vi /etc/ssh/sshd_config
====