I am writing a console-application in Delphi (for Windows), which uses the plink.exe in the background to connect to a device via ssh (redirecting stdin and stdout).
My wrapper is using the plinkremote component (http://www.delphipraxis.net/70989-komponente-fuer-ssh-verbindung-6.html).
To start a connection I have my wrapper ask the user for the username and password and then run the command [plink -pw "password" user@server], it connects and I am connected through my wrapper to the server.
Everything works as expected with one exception: If I type the password incorrectly the latest version of plink (ver. 0.63) comes up with an "interactive keyboard authentication" and asks for a password. At that point my wrapper stops working. Whatever I am typing is not being forwarded to the server, and the only way to get out is to close the command-prompt window all together. I found a way to disable this "interactive authentication" (by saving a putty-session with it disabled and loading that session within my wrapper), but plink still comes up with asking for a password, and my wrapper stops working the same way.
For the last few days I am trying to figure out why it stops working. I am not sure if in- or output gets redirected somewhere else (only when plink asks for a password). I would prefer plink to just close the connection if it cannot authenticate, then I could try to connect again right away, hopefully type the password correctly and be connected. A previous version of plink (ver. 0.60) does exactly that. Of course I would prefer to use the latest plink version, so I would like to figure out what is going on when plink cannot connect with the given credentials.
I did search and could not find a solution to this issue - the only question which sounds to be a similar issue was not answered (https://stackguides.com/questions/19458241/redirecting-the-dev-tty-for-a-plink-command).
Does anyone have an idea what might be wrong or how to disable the password-question in plink completely?
Thank you!