如何提交"Plink"授予访问权限.按“返回以开始会话".自动提示 [英] How to submit Plink "Access granted. Press Return to begin session" prompt automatically
问题描述
我正在编写一个简单的Windows批处理脚本,以允许我借助plink.exe
在远程服务器上执行一些Linux命令.
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 username@172.19.48.111 cd ~/project; make clean; make -j8
call plink %%argument1%%
总而言之,它将在远程服务器上重建我的C ++项目.
In a word, it will rebuild my C++ project on the remote server.
当我双击该批处理时,它起作用了,只是每次必须键入一个 Enter .
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
如您所见,在进入此窗口后,我必须输入 Enter 才能继续.
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?
推荐答案
从PuTTY 0.71开始,以交互方式登录时,出于安全目的,系统会提示您.请参见 PuTTY漏洞vuln-auth-即时欺骗.
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.
要使用批处理模式,请使用 -batch
开关.这样,您不仅摆脱了提示.当某些更改发生时,它还将确保命令不会挂在可能发生的其他各种提示上.而是命令立即失败.
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.
这篇关于如何提交"Plink"授予访问权限.按“返回以开始会话".自动提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!