我這樣理解所有使用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次(左右)交互式登錄過程(但不是交互式!)。