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. # ... server /etc/ssh/sshd_config ...
  13. # ...
  14. # Require public key, THEN password
  15. AuthenticationMethods publickey,password
  16. # ...

AltStyle によって変換されたページ (->オリジナル) /