Edit $HOME/.ssh/config, enter:

$ cat ~/.ssh/config

Host *
    ControlMaster auto
    ControlPath ~/.ssh/master-%[email protected]%h:%p.socket
    ControlPersist 30m