Refactor the ssh configuration into a separate private method.