ssh2/sftp doesn't work with chrooted/openssh sftp-internal user accounts (no shell)
|Reported by:||albert@…||Owned by:||albert@…|
The current wordpress 3.4.1 wp-admin/includes/class-wp-filesystem-ssh2.php code will crash php or spin in an endless loop when someone supplies ssh/sftp credentials (username/password) to an (open)ssh server where users don't have a shell and are chrooted to their home directory e.g. by using openssh's sftp-internal server and ChrootDirectory functionality.
There is no neat fix for the code in the WP_Filesystem_SSH2 class. I've implemented a new WP_Filesystem_SFTP class making use of the portable phpseclib library.
At this moment it is necessary to change a line in wp-admin/includes/file.php to be able to use WP_Filesystem_SFTP.
Attached is the code for this new class up for review or for anyone with the same problem.