非交互式ssh到服务器,但交互式
问题描述:
我这样理解所有使用ssh的安全风险,但我目前需要的是几行(bash)shell脚本能够登录到target
服务器,做一个Foo命令,并回到源主机,是这样的:非交互式ssh到服务器,但交互式
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密钥的身份验证,因为我真正需要的是模拟1次(左右)交互式登录过程(但不是交互式!)。