def METHOD_NAME(
    self,
    client: paramiko.SSHClient,
    host: TargetHost,
    username: Optional[Username],
    private_key: str,
    port: NetworkPort,
    timeout: float,
):
    try:
        private_key_buffer = io.StringIO(get_plaintext(private_key))
        private_key_object = paramiko.RSAKey.from_private_key(private_key_buffer)
    except (IOError, paramiko.SSHException, paramiko.PasswordRequiredException) as err:
        logger.error("Failed reading SSH key")
        raise err
    try:
        client.connect(
            str(host.ip),
            username=username,
            pkey=private_key_object,
            port=int(port),
            timeout=timeout,
            auth_timeout=SSH_AUTH_TIMEOUT,
            banner_timeout=SSH_BANNER_TIMEOUT,
            channel_timeout=SSH_CHANNEL_TIMEOUT,
            allow_agent=False,
        )
        logger.debug(
            f"Successfully logged into {host.ip} using {username}@{host.ip} user's private key"
        )
    except paramiko.AuthenticationException as err:
        error_message = (
            f"Failed logging into victim {host.ip} with {username}@{host.ip} user's"
            f"private key: {err}"
        )
        logger.info(error_message)
        raise err
    except Exception as err:
        error_message = (
            f"Unexpected error while attempting to login to {username}@{host.ip} with SSH key: "
            f"{err}"
        )
        logger.error(error_message)
        raise err