I'll think about extracting this duplicated code. But a bit fiddly because ssh uses `-p port` whereas scp uses `-P port`! For next pull request...