Topic "Error with script"

Author Message
[View user's profile]

Joined: 2016-12-19
Posts: 1

I have an issue with a script, which I created with a manual of WinSCP (

open sftp://user:password@servername/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"

I used user, password, server and ssh key as described, but I receive an authentication error.

"Access denied. Connection has been unexpectectedly closed. Server sent command exit status 0. Authentication failed."

When I use the script without password and enter it manually in the command line, everything works fine and I don't get an authentication error. Can anyone help? Is this a problem of the script or with my FTP server? I use a Synology NAS Storage as FTP server.

Thank you for your help.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
Please attach a full session log file for both scenarios.

To generate the session log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
[View user's profile]

Joined: 2016-12-08
Posts: 52
Location: MSK-RU
Try to change you password to simple one with out extra characters like $#&%^%@#$&*@^%#()

Or try to use:
open "sftp://user:password@servername/" -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License