Cannot authenticate using script?

Advertisement

o_o
Joined:
Posts:
10
Location:
Germany

Cannot authenticate using script?

Hi,
I have used the GUI version of WinSCP to transfer files from my home to my university Linux account since about a year. I am now getting into scripting, and I cannot figure out how to get this to work. I have gone through the documentation on scripting – and the FAQ – but still I think that I might be doing something obviously wrong.

Using the WinSCP GUI I can log in to my university account both using the keyboard and using a key. I now tried the following script: (called winscp_trial.sh in my My Documents) My username is masca
option batch on
option confirm off
open masca:passwd@something.uni-stuttgart.de
cd /home/home_dir
I started the cmd prompt on Win XP and got into the My Documents and then entered the following command:
"C:\Program Files\WinSCP3\WinSCP3.exe" /console /script=winscp_trial.sh

I get a black window that opens up with the following text
batch        on
confirm      off
Initialisation...
Searching for host...
Connecting to host...
Authenticating...
Using username "maca".
Using keyboard-interactive authentication.
Authenticating with pre-entered password.
Access denied.
Using keyboard-interactive authentication.
Authentication failed.
Authentication log (see session log for details):
Using username "maca".
Using keyboard-interactive authentication.
Authenticating with pre-entered password.
Access denied.
Using keyboard-interactive authentication.

Unable to authenticate
No session.
winscp>
Any ideas on what I need to do next. Thanks to all who take their time to help me.
Regards,
O.O.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Cannot authenticate using script?

Edit 2021: Use -privatekey switch of the open command:
https://winscp.net/eng/docs/scriptcommand_open#privatekey

If you login using private key, you have these options:
1) Setup stored session with associated key and use the name of the stored session as parameter of open command.
2) Use /privatekey command line option to specify default private key.
3) Use pageant.
Last edited by martin on 2008-02-14; edited 2 times in total

Reply with quote

o_o
Joined:
Posts:
10
Location:
Germany

Re: Cannot authenticate using script?

Dear Martin,
Thanks for responding. I don't know why I cannot login either using a password, or using a private key. However making a stored session and then using the name of the session in the script works.
I have a few more questions, but I think I would post a separate threads on those topics. Thanks for your site and taking the time to answer our questions.
Regards,
O.O.

Reply with quote

Advertisement

You can post new topics in this forum