【发布时间】:2011-12-21 05:08:04
【问题描述】:
我了解以这种方式使用 ssh 的所有安全风险,但我现在需要的是能够登录到 target 服务器并执行 foo 命令并获取的几行 (bash) shell 脚本返回源主机,类似于:
while true
do
ssh target foo # Here I get the prompt for a password which
# I would like to give non-interactively
sleep 1
done
我不想使用基于 ssh 密钥的身份验证,因为我真正需要的是每秒(左右)模拟一次交互式登录过程(但不是交互式!)。
【问题讨论】:
标签: bash login ssh sh ssh-keys