Authentication Failed
I am trying to automate using batch script to upload files to sftp directory. On the winscp GUI I have enter the credentials and I can successfully log on to the sftp directory. However when I try to connect to same sftp directory with same login credentials using winscp.com on command prompt i am getting an authentication error. This is just for testing to make my automate script work.
automate script works this way.
Batch file
date /T >>e:\log\transfer_sig-log.txt
@echo %username% >>e:\log\transfer_sig-log.txt
date /T >>e:\log\transfer_sig-log.txt
time /T >>e:\log\transfer_sig-log.txt
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=E:\SQL-Transfer\TransferSigFile.txt >>e:\log\transfer_sig-log.txt
transfer_sig-log.txt file
option batch on
option confirm off
open sftp://user_name:password@example.com:port -hostkey="ssh-dss 1024 34:23:z1:d2:c1:1c:41:76:5r:2d:e9:v9:34:q2:w9:12"
put E:\local_directory /sftp_directory
exit
Below is the error I am getting using above automated script
Authenticating with pre-entered password.
Host is not communicating for more than 15 seconds. Still waiting...
Note: If the problem repeats, try turning off 'Optimize connection buffer size'.
Warning: Aborting this operation will close connection!
(A)bort (60 s):
Access denied.
Connection has been unexpectedly closed. Server sent command exit status 0.
Authentication log (see session log for details):
Using username "user_name".
Access denied.
Authentication failed.
No session.
No session.
Please help ASAP thank you.
automate script works this way.
Batch file
date /T >>e:\log\transfer_sig-log.txt
@echo %username% >>e:\log\transfer_sig-log.txt
date /T >>e:\log\transfer_sig-log.txt
time /T >>e:\log\transfer_sig-log.txt
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=E:\SQL-Transfer\TransferSigFile.txt >>e:\log\transfer_sig-log.txt
transfer_sig-log.txt file
option batch on
option confirm off
open sftp://user_name:password@example.com:port -hostkey="ssh-dss 1024 34:23:z1:d2:c1:1c:41:76:5r:2d:e9:v9:34:q2:w9:12"
put E:\local_directory /sftp_directory
exit
Below is the error I am getting using above automated script
Authenticating with pre-entered password.
Host is not communicating for more than 15 seconds. Still waiting...
Note: If the problem repeats, try turning off 'Optimize connection buffer size'.
Warning: Aborting this operation will close connection!
(A)bort (60 s):
Access denied.
Connection has been unexpectedly closed. Server sent command exit status 0.
Authentication log (see session log for details):
Using username "user_name".
Access denied.
Authentication failed.
No session.
No session.
Please help ASAP thank you.