GUI and WinSCP.com work, Powershell does not
The important part of the Powershell is this. The password has a $ in it. The session log and debug logs are attached and the logs from the GUI when it worked. Any help is greatly appreciated. Please let me know if more information is needed. WinSCP 5.1.4
Get this error from the script. "Connection has been unexpectedly closed. Server sent command exit status 0."
. 2013-05-14 16:09:06.800 Attempting keyboard-interactive authentication
. 2013-05-14 16:09:07.002 Prompt (6, SSH server: Password Authentication, Using keyboard-interactive authentication., xxxxxx's password:)
. 2013-05-14 16:09:07.002 Using stored password.
. 2013-05-14 16:09:08.999 Keyboard-interactive authentication failed
! 2013-05-14 16:09:08.999 Access denied
. 2013-05-14 16:09:08.999 Attempting keyboard-interactive authentication
. 2013-05-14 16:09:09.233 Prompt (6, SSH server: Password Authentication, Using keyboard-interactive authentication., xxxxxxx's password:)
. 2013-05-14 16:09:09.233 Disconnected: Unable to authenticate
try
{
# Load WinSCP .NET assembly
[Reflection.Assembly]::LoadFrom("WinSCP.dll") | Out-Null
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
$sessionOptions.HostName = "xxxxx"
$sessionOptions.UserName = "xxxxx"
$sessionOptions.Password = "xxxxx"
$sessionOptions.SshHostKeyFingerprint = "ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
$session = New-Object WinSCP.Session
$session.SessionLogPath = "seslog.txt"
$session.DebugLogPath = "deblog.txt"
try
{
# Connect
$session.Open($sessionOptions)
# Upload files
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Automatic
Get this error from the script. "Connection has been unexpectedly closed. Server sent command exit status 0."
. 2013-05-14 16:09:06.800 Attempting keyboard-interactive authentication
. 2013-05-14 16:09:07.002 Prompt (6, SSH server: Password Authentication, Using keyboard-interactive authentication., xxxxxx's password:)
. 2013-05-14 16:09:07.002 Using stored password.
. 2013-05-14 16:09:08.999 Keyboard-interactive authentication failed
! 2013-05-14 16:09:08.999 Access denied
. 2013-05-14 16:09:08.999 Attempting keyboard-interactive authentication
. 2013-05-14 16:09:09.233 Prompt (6, SSH server: Password Authentication, Using keyboard-interactive authentication., xxxxxxx's password:)
. 2013-05-14 16:09:09.233 Disconnected: Unable to authenticate
try
{
# Load WinSCP .NET assembly
[Reflection.Assembly]::LoadFrom("WinSCP.dll") | Out-Null
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
$sessionOptions.HostName = "xxxxx"
$sessionOptions.UserName = "xxxxx"
$sessionOptions.Password = "xxxxx"
$sessionOptions.SshHostKeyFingerprint = "ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
$session = New-Object WinSCP.Session
$session.SessionLogPath = "seslog.txt"
$session.DebugLogPath = "deblog.txt"
try
{
# Connect
$session.Open($sessionOptions)
# Upload files
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Automatic