Guest User

Untitled

a guest
Jan 24th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #!/bin/sh
  2. select server in `cat ~/bin/server_list`
  3. do
  4. expect -c "
  5. spawn ssh ユーザ名@$server
  6. expect {
  7. \"Are you sure you want to continue connecting (yes/no)?\" {
  8. send \"yes\r\"
  9. expect \"password:\"
  10. send \"パスワード\"
  11. } \"ユーザ名@$server's password:\" {
  12. send \"パスワード\"
  13. }
  14. }
  15. interact
  16. "
  17. done
  18.  
  19. # 1. ssshとか名前つけて~/bin/ssshに保存。実行権限つけておく。~/binにpath通ってると楽。
  20. # 2. ~/bin/server_listに改行区切りでサーバを書いておく。
  21. # 3. sssh ってコマンド実行するとサーバ一覧がでて、数字で選択できる。自動PW入力でssh接続できる。
Add Comment
Please, Sign In to add comment