Home » Linux

SFTP/ScpOnly: Fix for WinSCP Error

23 November 2009 No Comment

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.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.