Topic "Password Failed..."

Author Message
honey_cutt
[View user's profile]

Joined: 2014-02-27
Posts: 3
I am trying to upload a file to an SFTP site using a powershell script. Each time i get an the error 'no supported authentication methods available'.

below is the code snippet and the log showing the error:

Code:
Powershell Code Snippet:
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
$sessionOptions.HostName = "ftp.site.com"
$sessionOptions.UserName = "username"
$sessionOptions.Password = "pass"
$sessionOptions.SshHostKeyFingerprint = "ssh-dss 1024 x:x:x:x:x:x:x:x:x:x:x:x:x:x:x:x"




Code:
Log Snippet:
! 2014-02-27 13:30:25.059 Using username "username".
! 2014-02-27 13:30:25.099 Further authentication required
. 2014-02-27 13:30:25.099 Further authentication required
. 2014-02-27 13:30:25.099 Prompt (7, SSH password, , &Password: )
. 2014-02-27 13:30:25.099 Using stored password.
. 2014-02-27 13:30:25.100 Sent password
. 2014-02-27 13:30:25.140 Password authentication failed
! 2014-02-27 13:30:25.140 Access denied
. 2014-02-27 13:30:25.141 Disconnected: No supported authentication methods available (server sent: )
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Are you able to connect using the password from WinSCP GUI? Is there some special character in your password? What version of WinSCP are you using? Have you tried 5.5.1?
honey_cutt
[View user's profile]

Joined: 2014-02-27
Posts: 3
@prikryl, thanks for the reply. when i use the winscp gui i connect just fine, no problems at all. there is a '$' in the password. i am using the latest 5.5.1 (build 3970).

after looking through the forums i have tried the following in powershell without success:

orignal password is: blah$blah

password = "blah" + "%24" + "blah"
password = "blah" + %24 + "blah"
$a = 24; password = "blah" + $a + "blah"
$a = "{0:x}" -f 36; password = "blah" + $a + "blah"

nothing seems to work for me, any ideas on how to pass the '$' character as UTF-8 hex in powershell or how to make the pass actually work.
honey_cutt
[View user's profile]

Joined: 2014-02-27
Posts: 3
i believe i found the problem. in powershell you have to escape the '$' with a backtick. if you don't powershell looks at it as a variable within the double qoutes. hope this helps some one else in the future.

honey_cutt wrote:
@prikryl, thanks for the reply. when i use the winscp gui i connect just fine, no problems at all. there is a '$' in the password. i am using the latest 5.5.1 (build 3970).

after looking through the forums i have tried the following in powershell without success:

orignal password is: blah$blah

Code:
password = "blah" + "%24" + "blah"
password = "blah" + %24 + "blah"
$a = 24; password = "blah" + $a + "blah"
$a = "{0:x}" -f 36; password = "blah" + $a + "blah"


nothing seems to work for me, any ideas on how to pass the '$' character as UTF-8 hex in powershell or how to make the pass actually work.
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