Here’s the fix for the common error with ScpOnly when using the Jail SFTP option. The error message for WinSCP clients is “WinSCP: this is end-of-file:0 failed with invalid output” when trying to connect to a SFTP server.
In Debian, go to the src folder for scponly:
cd /usr/share/doc/scponly/
There should be a file in there called “groups.c”
main()
{
printf("root users\n");
return 0;
}
As you can see, this is just a “dummy” file to output a sample command and 0 to WinSCP program. Harmless. Compile the file.
gcc -o groups groups.c
Copy the groups file to /home/[SFTP USER]/usr/bin
cp groups /home/[SFTP USER]/usr/bin
This should fix the error message. You will need to copy the groups file for all SFTP users and also update the .sh file to copy the new groups file when creating new users. I tested this in WinSCP Version 4.2.4 and it resolved the warning message problem.