def _compose_ssh_command(params):
    """
    Provided a ConnectionParams object, writes an SSH command with its properties
    :param params: ConnectionParams object
    :return: SSH command
    """
    command = f'ssh {params.options} {f"-i {params.key}" if params.key else ""} ' \
              f'{params.username}@{params.host} -p {params.port}'
    return " ".join(command.split())