【发布时间】:2014-03-05 16:34:06
【问题描述】:
我正在尝试使用 plink(Putty link) 使用批处理文件连接到测试服务器,以避免任何用户提示和执行 shell 脚本。但是它通过在使用我不想要的用户名和密码登录后显示用户交互提示而暂停。
请提供任何建议说明为什么会发生这种情况,或者我是否需要更改配置中的任何设置以使其正常工作。
以下是相同的日志。我希望它在此步骤之后执行一个 shell 脚本,在此之前它会停止并且 plink 将我置于交互式 shell 中
D:\>plink -v -ssh xxx@xxx.xxx.xxx.xx.com –pw XXXXX
Looking up host "xxx@xxx.xxx.xxx.xx.com"
Connecting to xxx.xx.xxx.xx port 22
Server version: SSH-2.0-OpenSSH_5.1
Using SSH protocol version 2
We claim version: SSH-2.0-PuTTY_Release_0.63
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-256
Host key fingerprint is:
ssh-rsa 1024 a5:c3:96:57:53:7c:72:06:8d:86:09:76:27:3e:18:8d
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Using username "xxx".
Attempting keyboard-interactive authentication
Access granted
Opening session as main channel
Opened main channel
Allocated pty (ospeed 38400bps, ispeed 38400bps)
Started a shell/command
Last login: Wed Mar 5 09:56:41 2014 from 10.34.39.22
←[?1034hxxxxavu2:←]2;xxx@xxxxavu2~ >
【问题讨论】:
标签: unix batch-file ssh plink