Topic "Disconnected: Unable to authenticate"

Author Message
cpezie
[View user's profile]

Joined: 2012-09-23
Posts: 2
Location: VA
I have winSCP installed on my Win Server 2008 box. I have batch job configured to SSH to a Linux box nightly, login with credentials saved in winSCP. The job copies files from Win server to a directory on the linux server.
The job always fails with a error: Unable to authenticate. If I run the batch file myself it works fine. I had this same batch/scheduled task working fine on my Win Server 2000 box prior to moving to 2008.

When Task Mgr runs the batch job the following output is produced in my log file:
! 2014-04-08 11:53:22.677 Using username "xxx".
. 2014-04-08 11:53:22.679 Prompt (7, SSH password, , &Password: )
. 2014-04-08 11:53:32.681 Disconnected: Unable to authenticate

When I double-click the batch file the following is produced in the log file and the job runs successfully:

! 2014-04-08 11:56:28.277 Using username "xxx".
. 2014-04-08 11:56:28.280 Prompt (7, SSH password, , &Password: )
. 2014-04-08 11:56:28.280 Using stored password.
. 2014-04-08 11:56:28.280 Sent password
. 2014-04-08 11:56:28.284 Access granted
. 2014-04-08 11:56:28.352 Opened channel for session
. 2014-04-08 11:56:28.357 Started a shell/command

The difference in the output above tells me that when the batch file is run from Task Mgr it's not referencing the stored password. So how do I force it to use the stored password?
cpezie
[View user's profile]

Joined: 2012-09-23
Posts: 2
Location: VA
I figured it out ie. I found the help file "Running a Script under a Different Account (e.g., Using a Scheduler)".

So I basically had to migrate the registry file from my profile to the service acct's profile b/c that's the account that runs the job.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
cpezie wrote:
I figured it out ie. I found the help file "Running a Script under a Different Account (e.g., Using a Scheduler)".

Link for benefit of other users:
https://winscp.net/eng/docs/scripting#different_account
And related FAQ:
https://winscp.net/eng/docs/faq_scheduler
_________________
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