# Keep receving authenticating w/ pre-entered password..why!?!

LostAsCanBe
Guest

## Keep receving authenticating w/ pre-entered password..why!?!

When I created a user name and password and hit login it worked, now when I hit login under the same user, this promt "authenticating with pre-entered password" comes up and when I enter in my password I get denied..WHY!?!=(

martin
Joined:
Posts:
38,425
Location:
Prague, Czechia

## Re: Keep receving authenticating w/ pre-entered password..why!?!

Please read documentation. If that does not help, come back and post a log file.

neo4
Guest

## i cant ssh

When I press login after I fill everything right, I get this message:
plz help

alexandern
Guest

I had a similar problem, everything would work in interactive mode but using the password in a script would fail.

E.g.
open sftp://some-user:my+1password@someserver.com
should be
open sftp://some-user:my%2B1password@someserver.com
Here use this to encode
https://winscp.net/eng/docs/session_url#special

Jens Frandsen
Guest

## Re: "pre-entered password" fails, (FIX)

@alexandern - Thanks for so much for answering the question. I had a similar problem and had already read much of the documentation. The previous responses frustrated me as they clearly not helpful at all. Those types of responses could be generated by bot. Alas, here you not only posted the exact answer I needed, but you gave an example that helped me to instantly understand what you were saying. Now I'm thinking "got to write a script to encode my password, here I go" ... but you you really went the extra mile and provided the handy link to encode a password. Great answer, please keep up the good work.

LUX
Guest

## Re: "pre-entered password" fails, (FIX)

@alexandern: Great. Thank you! This was the clear answer for this question. The link to the encoding webpage was really helpful.
:D

Travis M
Guest

## Re: "pre-entered password" fails, (FIX)

@alexandern: That was the fix for me. Thank you very much! You saved my day.

Gilles.D
Guest

## Connection has been unexpectedly closed. Server sent command exit status 0.

Hello,

to connect to my server I use the following commands:
option batch on
option confirm off
open sftp://otuser:OTMC4societe!@ptrimv03:22
But when connecting here is the error message that I have:
batch           on
confirm         off
Searching for host...
Connecting to host...
Authenticating...
Connection has been unexpectedly closed. Server sent command exit status 0.
Authentication log (see session log for details):
Authentication failed.
Obviously to connect to the server I must, after filling in the login and password, validate my connection, but I do not know how to fill that in the command line.

Could you help me?

Gilles

martin

## Re: Connection has been unexpectedly closed. Server sent command exit status 0.

@Gilles.D: The credentials in the script are wrong. Are you able to connect in GUI? If you are, follow the advice in my previous post.

syed
Guest

## Script error in Authenticating with pre-entered password

When I run below script, it's still giving error, while this script is generated from WinSCP GUI (Generate session URL/code). Now when I use command line then same user & password works normally but it does not work in script mode and give error. So, how do I fix this issue?

Batch file:
"E:\BACKUP\WinSCP.com" ^
/log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
/command ^
"open sftp://cgpexpert:mt2013%%40HW@10.78.144.209/ -hostkey=""ssh-rsa 2048 g3UQWIbxa6xRT/ExIKbYGdoH5XVKkgGxte6tj7ApS2g=""" ^
"dir" ^
"cd /" ^
"exit"
output:
Error occurred during logging. It's been turned off.
Can't open log file 'C:\writable\path\to\log\WinSCP.log'.
System Error. Code: 2.
The system cannot find the file specified
Searching for host...
Connecting to host...
Authenticating...
Authenticated.
Starting the session...
Connection has been unexpectedly closed. Server sent command exit status 127.
Cannot initialize SFTP protocol. Is the host running an SFTP server?

syed
Guest

## Script error in Authenticating with pre-entered password

I got the solution from anther thread on this platform to use SCP instead of SFTP.
"E:\BACKUP\WinSCP.com" ^
/log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
/command ^
"open scp://cgpexpert:mt2013%%40HW@10.78.144.209/ -hostkey=""ssh-rsa 2048 g3UQWIbxa6xRT/ExIKbYGdoH5XVKkgGxte6tj7ApS2g=""" ^
"dir" ^
"cd /" ^
"exit"

martin