add hardware authentication via expect example
Change-Id: I897b580524fa7bd33fb61538411ae10f453ea9b7
This commit is contained in:
parent
ff69508da9
commit
0d67b545b8
|
@ -0,0 +1,11 @@
|
|||
set switch_ip [lindex $argv 0]
|
||||
set switch_pass [lindex $argv 1]
|
||||
|
||||
spawn ssh "root@$switch_ip"
|
||||
set timeout 500
|
||||
expect "yes/no" {
|
||||
send "yes\r"
|
||||
expect "*?assword" { send "$switch_pass\r" }
|
||||
} "*?assword" { send "$switch_pass\r" }
|
||||
expect "# " { send "show run" }
|
||||
expect "# " { send "exit\r" }
|
Loading…
Reference in New Issue