[英]Non-interactively ssh to server but interactively
I understand all the security risks using ssh in this way, but what I need at the moment is a few line (bash) shell script capable to log-in to the target
server and just do a foo command and get back to the source host, something like: 我以这种方式理解使用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
I do not want to use the ssh key based authentication because what I truly need is to simulate once a second (or so) the interactive log-in process (but not-interactively!). 我不想使用基于ssh密钥的身份验证,因为我真正需要的是每秒模拟一次(或左右)交互式登录过程(但不是交互式!)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.