sshでclient loop: send disconnect: Broken pipeしてしまう場合
1. ~/.ssh/known_hostsから接続先のサーバーがある行を消す
学科サーバーの場合は10.100や133.13やu-ryukyuなど
接続したいサーバーによって適宜読み替える
2. ~/.sshの鍵とconfigの中身を確認する
存在しないユーザーでアクセスに行っているとか
存在しない鍵を指定しているとか
そもそも ~/.sshのパーミッションがおかしいとか
3. ~/.ssh/configに個別で設定を書く
code:~/.ssh/config
Host *
AddKeysToAgent yes
UseKeyChain yes
Host yomitan
HostName yomitan.ie.u-ryukyu.ac.jp
port 22
IdentityFile ~/.ssh/id_rsa
User e2057xx
StrictHostKeyChecking no
ServerAliveInterval 300
ServerAliveCountMax 10
ControlMaster auto
ControlPath ~/.ssh/mux-%r@%h:%p
ControlPersist 30m
こうすると $ssh yomitan みたいな形で接続可能
yomitanサーバーに接続に行く時だけ ServerAliveCountMaxなどの設定が有効化される
影響範囲が狭いのでおすすめ
4. ~/.ssh/configに以下の情報を追記する
Host *にしておくと接続する先のホスト全ての設定が可能
予期せぬエラーが出る可能性があるので最終手段
code:~/.ssh/config
Host *
AddKeysToAgent yes
UseKeyChain yes
StrictHostKeyChecking no
ServerAliveInterval 300
ServerAliveCountMax 10
ControlMaster auto
ControlPath ~/.ssh/mux-%r@%h:%p
ControlPersist 30m