SFTP Password problem in batch file

Advertisement

JLM
Joined:
Posts:
5
Location:
De

SFTP Password problem in batch file

My WinSCP Version is 5.15.1 (Build 9407)
In WinSCP-GUI (Example in the attachment) it works, but in batch-Script not

Example:
„internet-aaa.bbb.de“ is a proxy with password protection
„sftp.dis-boncult“ is the sftp-server I want to connect on

The Code-generator gives me only a version with one password
open sftp://user5,user5_jju@sftp.dis-boncult.de:Password1@internet-aaa.bbb.de/
but I need the password for the proxy too
open sftp://user5,user5_jju@sftp.dis-boncult.de:Password1@internet-aaa.bbb.de:Password2/
But it doesn't works. Can you please give me an example how I can solve this problem.
  • WinSCPGUI.PNG (37.44 KB, Private file)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: SFTP Password problem in batch file

So how do you authenticate in the GUI? Please post a session log file for the GUI session.

Reply with quote

JLM
Joined:
Posts:
5
Location:
De

Re: SFTP Password problem in batch file

In the GUI the password for the proxy is stored in the field "Kennwort". After pressing the button "Anmelden" a Window-Dialog pops up and asking me to enter the sftp-server password.

But in batch-Script I get this error
...
2020-08-05 00:30:03.254 Sent password
. 2020-08-05 00:30:03.254 Password authentication failed
! 2020-08-05 00:30:03.254 Access denied
. 2020-08-05 00:30:03.254 Server offered these authentication methods: password
. 2020-08-05 00:30:03.254 Prompt (password, "SSH password", <no instructions>, "&Passwort:")
. 2020-08-05 00:30:03.254 Disconnected: Unable to authenticate

Reply with quote

JLM
Joined:
Posts:
5
Location:
De

Re: SFTP Password problem in batch file

In the Attachement you can find the session log file for the GUI session.
  • nZ2_wusr5,user5_jju@sftp.dis-boncult.de@internet-aaa.bbb.de.log (74.75 KB, Private file)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: SFTP Password problem in batch file

OK, scripting does not support this.
This issue has been added to the tracker:
https://winscp.net/tracker/1928
You can vote for it there.

Meanwhile, you might be able to use input redirection to provide the second password:
echo password2| winscp.com /script=yourscript_with_passord2.txt

Reply with quote

JLM
Joined:
Posts:
5
Location:
De

Re: SFTP Password problem in batch file

I have tried your suggestion. But it doesn't work for me. In the script-file (open...) it is not possible to grab the password from the command line. I can't provide the password for "further authentication". Can you please explaion me how to provide the password2 in the script file.

Snippet from Log-File:
Prompt (password, "SSH password", <no instructions>, "&Passwort:")
. 2021-02-09 16:13:52.760 Using stored password.
. 2021-02-09 16:13:52.760 Sent password
! 2021-02-09 16:13:53.072 Further authentication required
. 2021-02-09 16:13:53.072 Further authentication required
. 2021-02-09 16:13:53.072 Server offered these authentication methods: passwordXX,ˆXXXXXXXXXXXXXXXXXXXXXXXXXXXXXi
. 2021-02-09 16:13:53.072 Prompt (password, "SSH password", <no instructions>, "&Passwort:")
. 2021-02-09 16:13:53.072 Disconnected: Unable to authenticate

Reply with quote

JLM
Joined:
Posts:
5
Location:
De

Re: SFTP Password problem in batch file

I have added the log file in the Attachement
  • log_20210212.txt (5.47 KB, Private file)

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: SFTP Password problem in batch file

Please try the latest version of WinSCP.

If this does not help, I have sent you an email with a debug version of WinSCP to the address you have used to register on this forum.

Reply with quote

Advertisement

You can post new topics in this forum