using Expect for ssh auto-login

#!/bin/bash

set -x
> /root/.ssh/known_hosts
echo "Connecting to host"
konsole --new-tab -e \expect -c "set timeout -1;\
spawn ssh 192.168.50.103 -l root ;\
match_max 100000;\
expect *(yes/no)?*;\
send -- yes\r;\
expect *password:*;\
send -- qwerasdf\r;\
interact;"



No comments:

Other Articles

Enter your email address: