Initial commit
This commit is contained in:
17
reset_scripts/ssh_linux.exp
Normal file
17
reset_scripts/ssh_linux.exp
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set user [lindex $argv 0]
|
||||
set pass [lindex $argv 1]
|
||||
set ip_addr [lindex $argv 2]
|
||||
set new_pass [lindex $argv 3]
|
||||
|
||||
spawn ssh -o "StrictHostKeyChecking no" $user@$ip_addr passwd
|
||||
expect "assword:"
|
||||
send "$pass\r"
|
||||
expect "Current password:"
|
||||
send "$pass\r"
|
||||
expect "password:"
|
||||
send "$new_pass\r"
|
||||
expect "password:"
|
||||
send "$new_pass\r"
|
||||
expect eof
|
||||
Reference in New Issue
Block a user