WinSCP: Current SFTP-3 session does not support command you request. Separate shell session may be opened to process the command

StackOverflow https://stackoverflow.com/questions/11836302

  •  24-06-2021
  •  | 
  •  

Question

I'm using WinSCP to interact with a remote server that supports only SFTP and doesn't allow SSH access.

My interaction involves moving/deleting a subset of files (identified by file names) in a certain directory.

To simplify this, I would typically synchronize [ Remote -> Local ], delete the files locally using the cygwin commandline (so that I can specify a list of file names instead of selecting files in the GUI) and then synchronize [ Local -> Remote ] to push the deletes to remote.

But, now, I want to further simplify the process so I can hand this over to an operations person. I went looking and was delighted to find that WinSCP supports 'commands'.

It would be great if I could enter something like this in the 'Command' field at the bottom in the 'Commander' view of WinSCP:

get queue-queue-from-DLQ-ID-69703273-db51-11e1-ba9f-005056010165 \
    queue-queue-from-DLQ-ID-3d64697a-db51-11e1-b86e-005056010166 \
    queue-queue-from-DLQ-ID-76fdb365-db50-11e1-b78d-005056010164 \
    queue-queue-from-DLQ-ID-76ed3836-db50-11e1-ba9f-005056010165

But when I enter this in the 'Command' field, I get the following error:

Current SFTP-3 session does not support command you request. Separate shell session may be opened to process the command. Do you want to open separate shell session?

Error 1

When I hit ok, I get the following error:

Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).

Error 2

The latter one is probably due to the fact that SSH is not supported.

But my question is, since get is an SFTP command, why am I getting the first error? Doesn't WinSCP itself use that command under the covers to support a GUI 'copy to local' operation?

How can I configure either WinSCP or the Linux box so that I can do what I have shown above?

Was it helpful?

Solution

I guess this answers my question: http://winscp.net/eng/docs/remote_command

Apparently, the 'Command' feature is only supported for SCP.

I wonder why WinSCP can't expose a commandline interface for SFTP operations that are generally supported during an sftp interactive session.

OTHER TIPS

You can use WinSCP command-line scripting interface to run the get command.

https://winscp.net/eng/docs/scripting


The 'Commands' feature (remote commands execution) is supported even for SFTP protocol. But this feature executes the command on remote server. You cannot use this feature to automate WinSCP. And there's no remote command that you can easily use to download file.
See https://winscp.net/eng/docs/remote_command

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top