I'm writing a simple Windows batch script to allow me to execute some Linux command on my remote server with the help of plink.exe
.
call set argument1=plink -pw mypwsswd [email protected] cd ~/project; make clean; make -j8 call plink %%argument1%%
In a word, it will rebuild my C++ project on the remote server.
When I double click the batch, it works except that I have to type an Enter each time.
Access granted. Press Return to begin session
As you see, after I getting this windows, I have to type an Enter to continue.
Is there some way to avoid this? For example, typing an enter automatically?
I'd recommend you stick with PuTTY too. You might find it useful to run Pageant in conjunction with Plink to avoid having to type in the passphrase.
Plink (PuTTY Link) is a command-line connection tool similar to UNIX ssh . It is mostly used for automated operations, such as making CVS access a repository on a remote server.
More typically Plink is used with the SSH protocol, to enable you to talk directly to a program running on the server.
Since PuTTY 0.71 you get that prompt for security purposes, when you login in an interactive mode. See PuTTY vulnerability vuln-auth-prompt-spoofing.
To use a batch mode, use -batch
switch. That way you not only get rid of that prompt. It will also make sure the command does not hang on various other prompts that may occur, when something changes. Instead the command fails straight away.
If you want to keep the interactive mode, but avoid this specific prompt only, use -no-antispoof
switch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With