Topic "Server sent command exit status 127"

Author Message
stephan.uzzell

Guest


I've been working on a project that includes using winscp to sftp a file to a linux host. It had been working initially, but something has changed somewhere (OS level I suppose) and now it isn't. I know that isn't much to work with, but I am hoping I can get some troubleshooting tips.

I've been using the syntax
winSCP.exe /console /command "open sftp://oracle:<PASSWORD>@ENLIHGP03ODB01 -hostkey=*"

I get the onscreen output:
Searching for host...
Connecting to host...
Authenticating...
Using username "oracle".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Connection has been unexpectedly closed. Server sent command exit status 127.
Cannot initialize SFTP protocol. Is the host running a SFTP server?

I can connect from the same Windows host to the same Linux host using the WinSCP GUI.

I tried turning on logging by adding the following to my command line call: /log "W:\Install\Private\Oracle\Scripts\Linux\Migration_MMP1\winscp_cmd.log" but I did not get any logfile.

Any advice?

Thanks,
stephan
Advertisements
stephan.uzzell
[View user's profile]

Joined: 2014-09-16
Posts: 2
OK, I figured out the problem with the log syntax. I've generated logs for both CLI and GUI, but not sure I know what the difference between the two is.

Thanks,
stephan
winscp_cmd.log (5.39 KB) [Download]

Description: CLI log

oracle@enlihgp03odb01.log (14.31 KB) [Download]

Description: GUI log

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
In GUI, your actually use SCP protocol. While you have SFTP protocol selected seemingly, you also have SCP fallback enabled. As your server does not seem to allow SFTP, WinSCP falls back to SCP. In scripting, the fallback is not enabled, so WinSCP fails. Use SCP instead (scp://) or fix your server to allow SFTP.
_________________
Martin Prikryl
stephan.uzzell
[View user's profile]

Joined: 2014-09-16
Posts: 2
Martin,

That did it - I changed my script from sftp:// to scp:// and it works. Thank you!

stephan
Siva123

Guest


I changed my script from sftp:// to scp:// and it works. Thank you!
linux guy

Guest


worked for me too thx
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License