Add more tests and add ssh sudo script

This commit is contained in:
gbaconni
2021-11-08 17:58:25 +01:00
parent b0efcdc5a3
commit 7b898eb0a7
3 changed files with 85 additions and 2 deletions

11
ssh_sudo.exp Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/expect --
set timeout -1
set send_human {.05 0.1 1 .07 1.5}
eval spawn ssh -t -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no $argv
match_max 100000
expect "*?assword:*"
send -- "$env(SSHPASS)\r"
send -- "\r"
expect "*?assword for*"
send -- "$env(SSHPASS)\r"
interact