- どの環境でも ~/.ssh/config を統一したい
- ssh の多重化をしたい
- だけど MSYS2(やCygwin)は ssh の多重化が出来ないので何とかしたい
という人向けです
/.ssh/config†
# MSYS2に特化した設定
Match Exec "uname | grep -qE '(MSYS|MINGW)'"
ControlMaster no
Match All
# 以下、共通の設定(MSYS2は先に記載した ControlMaster が採用される)
ControlPath ~/.ssh/mux/%C
ControlMaster auto
ControlPersist 1d
ポイント†
- ssh_configは先勝ちなので、先に MSYS2 用の設定(ControlMaster)を設定する
- (表現が変だけど)Match Exec hoge を閉じるには Match All が使える
- あるいは Match Host * でもOK(こっちの方が見慣れてて良いかも)