作者hardware (硬體)
看板Linux
標題[問題] shell script "enter"
時間Tue Dec 15 18:06:56 2015
我查網路上大家都說用
bash file:
ssh
[email protected]
echo '\n'
但是我使用卻無效
我的環境是長這樣
zzzzz@zzzz:~/zzzzz$ sh open_enbd.sh
[email protected]'s password:
卡在這裡 進不去 密碼那邊如果自己執行是要用手動按下enter
不曉得有沒有人知道?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.117.89.77
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Linux/M.1450174019.A.6F0.html
1F:推 filiaslayers: 用expect 12/15 18:25
2F:→ kenduest: 程式碼是說執行 ssh 結束之後才 echo 命令會執行 12/15 18:38
3F:→ kenduest: 若你要密碼帶入登入功能,sshpass 比較適合你的需求 12/15 18:39
4F:→ hardware: 感謝一樓~ 12/15 20:42
5F:推 lspci: 你確定要寫明碼進script? 不考慮ssh key? 12/15 21:20
6F:推 soem: 與其這樣,可以的話倒不如建一組keypair,還比較方便 12/15 21:56
8F:→ Johnnyvip: 若是只使用固定機器登入的話 這種會比較方便 12/16 00:50
9F:推 Bencrie: 用金鑰吧 12/16 09:35