[問題] ssh加上Nf參數如何搭配expect?

看板Linux作者 (司馬雲)時間11年前 (2015/02/03 23:50), 11年前編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
我的expect檔案長這樣 #!/usr/bin/expect set timeout 30 spawn ssh mysite expect "Password:" send "pass" interact 如果ssh沒加Nf參數是沒問題,但加了一輸入完密碼就斷線了 請問該怎麼改寫呢?google了很久找不到有人有跟我一樣的問題 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.132.147.49 ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1422978622.A.9F5.html

02/04 00:15, , 1F
建議用 sshpass 程式就可以了... 比較 okay
02/04 00:15, 1F
我試試看,感謝 ※ 編輯: filiaslayers (218.161.95.118), 02/04/2015 09:29:15

02/05 22:07, , 2F
sshpass +1
02/05 22:07, 2F
文章代碼(AID): #1KqEu-dr (Linux)
文章代碼(AID): #1KqEu-dr (Linux)