#!/bin/bash
target="192.168.1.100"
password="123456"
/bin/expect -c "
set timeout 30
spawn ssh $target
expect {
"*yes/no*" { send "yesr"; exp_continue }
"*password*" { send "$passwordr" }
}
expect {
"*password*" { exit 1 }
}
"
if [ $? -eq 1 ]; then
echo
echo "ERROR PASSWORD"
fi



