Posted to tcl by ACfromTX at Sat Jul 19 01:52:04 GMT 2025view raw

  1. # ... Expect/TCL code ...
  2. # ...
  3. spawn {*}$ssh_cmd
  4. expect {
  5. "passphrase for ${key1}" { send "${passphrase1}\r" ; exp_continue }
  6. "passphrase for ${key2}" { send "${passphrase2}\r" ; exp_continue }
  7. "${user1}*ssword" { send "${pw1}\r" ; exp_continue }
  8. "${user2}*ssword" { send "${pw2}\r" ; exp_continue }
  9. -re "(failed|invalid) password { abort }
  10. }
  11. # ...
  12.  
  13. # ... server /etc/ssh/sshd_config ...
  14. # ...
  15. # Require public key, THEN password
  16. AuthenticationMethods publickey,password
  17. # ...

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week