主机密钥身份验证,而不从Windows命令行给出“y”

时间:2017-07-26 12:48:19

标签: batch-file windows-console plink

我在本地Windows命令行中使用了plink -pw password ec2-user@10.0.0.0

它要求主机密钥确认y / n enter image description here

如何从plink命令自动给出“y”?

我使用echo Y| plink -pw password ec2-user@10.0.0.0,但它没有用。

1 个答案:

答案 0 :(得分:-1)

以下是plink的使用情况概述:

plink
PuTTY Link: command-line connection utility
Release 0.53
Usage: plink [options] [user@]host [command]
       ("host" can also be a PuTTY saved session name)
Options:
  -v        show verbose messages
  -load sessname  Load settings from saved session
  -ssh -telnet -rlogin -raw
            force use of a particular protocol (default SSH)
  -P port   connect to specified port
  -l user   connect with specified username
  -m file   read remote command(s) from file
  -batch    disable all interactive prompts
The following options only apply to SSH connections:
  -pw passw login with specified password
  -L listen-port:host:port   Forward local port to remote address
  -R listen-port:host:port   Forward remote port to local address
  -X -x     enable / disable X11 forwarding
  -A -a     enable / disable agent forwarding
  -t -T     enable / disable pty allocation
  -1 -2     force use of particular protocol version
  -C        enable compression
  -i key    private key file for authentication

我想-batch开关就是你想要的。