How to set SFTP protocol version through the command line

Advertisement

PiperRod
Joined:
Posts:
6
Location:
Baltimore, MD

How to set SFTP protocol version through the command line

I'm using WinSCP 4.0.6 Build 358.

I'm trying to connect to a new vendor. I was receiving the errors

Cannot initialize SFTP protocol. Is the host running a SFTP server?
(Exception) Error decoding SFTP packet (111, 4, 111).

I have been able to get around this and connect to them using the Windows interface by setting the Preferred SFTP Protocol Version to 4 for this particular vendor. Now I'm working on automating the upload to them using WinSCP through the command line and I'm back to getting the same error. How can I set the Preferred SFTP Protocol Version through the command line?

Reply with quote

Advertisement

saity
Guest

How to enforce sftp version in command line

PiperRod wrote:

Thanks! That corrected my problem.

I am facing the same issue, could you or martin help me here, only example will also be helpful. Thanks.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: How to enforce sftp version in command line

saity wrote:

I am facing the same issue, could you or martin help me here, only example will also be helpful. Thanks.
With latest beta 5.0.5 you can do:
open username@hostname -rawsettings SFTPMaxVersion=3
See https://winscp.net/eng/docs/scriptcommand_open
_________________
Martin Prikryl

Reply with quote

saity
Guest

Re: How to enforce sftp version in command line

martin wrote:

saity wrote:

I am facing the same issue, could you or martin help me here, only example will also be helpful. Thanks.
With latest beta 5.0.5 you can do:
open username@hostname -rawsettings SFTPMaxVersion=3
See https://winscp.net/eng/docs/scriptcommand_open

Martin,
5.0.5 is working fine with code you suggested in command prompt, but I am using it in SSIS and I am getting the error as below,

"In Executing "c:\Program Files\WinSCP\WinSCP.exe" "/script="E:\SSIS\test.txt"" at "", The process exit code was "1" while the expected was "0"."

test.txt contain the command lines, the same worked fine in older version.

I tried couple of options but unable to make it work. any suggestions, any kind of help be highly appreciable

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: How to enforce sftp version in command line

saity wrote:

"In Executing "c:\Program Files\WinSCP\WinSCP.exe" "/script="E:\SSIS\test.txt"" at "", The process exit code was "1" while the expected was "0"."
Please post a full log file showing the problem.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum