rsync over one persistent SSH connection

A deploy that runs rsync three times and then a handful of remote commands opens a new SSH connection each time, and each one pays the full handshake — noticeable on a high-latency link and unnecessary.

# ~/.ssh/config
Host deploy-*
  ControlMaster auto
  ControlPath   ~/.ssh/cm-%r@%h:%p
  ControlPersist 60s

# the first command opens a socket; the rest reuse it
rsync -az ./public/ deploy-web:/var/www/app/public/
ssh deploy-web 'systemctl reload php7.0-fpm'

Subsequent connections travel over the existing socket and skip authentication entirely, which turns a twelve-step deploy from a dozen handshakes into one. ControlPersist keeps it alive briefly after the last command so a follow-up is also fast. The socket path must be unique per user, host and port or two deploys to different servers share a connection and fail confusingly.