Topic "Problem with Authentication"

Author Message
Gerhard_S
[View user's profile]

Joined: 2011-11-12
Posts: 8
Location: Berlin, Germany
Hi,
WinSCP works fine using the Windows GUI. Connection is done via SFTP, the host uses port 2222. When using a script, my password is rejected.
At the command prompt I enter:
winscp.exe /ini=WinSCP.ini /log=logfile.txt /console /script=login.txt

login.txt is:

option confirm off
open bewa43.berliner-wassertisch.net:<mypassword>@berliner-wassertisch.net -hostkey="ssh-rsa 2048 xx:xx:xx"
cd /httpdocs
option transfer binary
get htaccess.txt d:\
close
exit

The logfile says at the end:
Prompt (7, SSH password, , &Passwort:)
Using stored password.
Sent password
Access denied
Access denied
Prompt (7, SSH password, , &Passwort:)
Disconnected: Unable to authenticate

xx:xx:xx and <mypassword> are replaced by the appropriate values.
Is there any solution? Is the password stored in WSCP.ini only a dummy?
Gerhard_S
[View user's profile]

Joined: 2011-11-12
Posts: 8
Location: Berlin, Germany
I got it to run. The clue is in the content of the WinSCP.ini: this file contains the password (if this option was selected), the SSH key, and the last session (if selected). So, the script can look like:

# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect (pw is in winscp.ini)
open <username>@<host name>
# Change remote directory
cd /httpdocs
# Force binary mode transfer
option transfer binary
# Download file to the local directory d:\
get htaccess.txt d:\
# Disconnect
close
# Exit WinSCP
exit

The command line is:
winscp.exe /ini=WinSCP.ini /log=logfile.txt /console /script=login.txt
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
I do not see anythong wrong about your original open command.
But maybe you have some special charactrs in your password?
See here: http://winscp.net/eng/docs/session_url
_________________
Martin Prikryl
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