How can I fix the “Server refused to start shell/command” error when using SCP with WinSCP .NET?

Advertisement

onghyr
Joined:
Posts:
1
Location:
New York

How can I fix the “Server refused to start shell/command” error when using SCP with WinSCP .NET?

First of all, I would like to say that this library is excellent, and I truly appreciate it. I have been assigned to develop a small application that edits weather forecast data files and uploads them to an SFTP server. These files are then picked up by a maritime broadcasting system (CMB/NAVTEX) and transmitted to specific stations within a marine radio simulation environment.

Initially, I used the WinSCP .NET library, and everything worked smoothly. I also set up a local SFTP server (SolarWinds SFTP) for testing, and the application behaved exactly as expected.

However, I later discovered that the workstations in the simulation (currently using the WinSCP client) are configured to use SCP as the file transfer protocol instead of SFTP. Since I am not very familiar with the technical differences between SFTP, SCP, and SSH, I attempted to switch my configuration to SCP (for example, changing the Protocol to SCP and adjusting the server settings accordingly), assuming it would continue to work in my development environment.

Unfortunately, I encountered the error: “Server refused to start shell/command.” This issue occurs both in my C# application and when using the full WinSCP client. Meanwhile, in the simulation environment, they are still able to use SCP via WinSCP to upload files without any problems.

This leads me to believe that the issue might be related to my server configuration. At the moment, everything works correctly when using SFTP, but I would like to find a way to make it work with SCP if possible.

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
42,771
Location:
Prague, Czechia

Re: How can I fix the “Server refused to start shell/command” error when using SCP with WinSCP .NET?

WinSCP has specific requirements regarding the server when working in SCP mode. Particularly it needs a *nix-like shell:
https://winscp.net/eng/docs/requirements#scp

The (probably Windows) SolarWinds server SCP implementation might not be compatible with it. While your "simulation" SCP server is possibly Linux, so it works with WinSCP.

Reply with quote

Advertisement

You can post new topics in this forum