作者 Anonymous [actionscript] 2012-06-04 10:37 (点击下载)

  1. cat > $TUNNEL_DIR/expect.ssh-keygen.exp << EOF
  2. #!/usr/bin/expect -f
  3.  
  4. # TIMEOUT
  5. #set timeout -1
  6. set timeout 20
  7.  
  8. # Login parameters
  9. set ip_address [lindex $argv 0]
  10. set key_path [lindex $argv 1]
  11. #set cmdfile [ open [lindex $argv 5] ]
  12.  
  13. spawn ssh-keygen -C "$ip_address"
  14. expect {
  15. "*save the key" {send "$key_pathr";exp_continue}
  16. "*passphrase" {send "r";exp_continue}
  17. "Overwrite (y/n)?" {send "yr";exp_continue}
  18. }
  19.  
  20. expect eof

提交下面的校正或者修改. (点击这里开始一个新的帖子)
姓名: 在 cookie 中记住我的名字

屏幕抓图:(jpeg 或 png)