Skip to content

MaxAuthTries too small, auth fails with more than 2 SSH keys on client #616

Description

@matthijskooijman

BorgWarehouse version : 3.1.2
Installation type : Docker


Describe the bug
SSH is configured with MaxAuthTries=2, which apparently only means you can try at most 2 SSH keys.

I have three keys in my agent, and am using ssh_command: ssh -i /etc/borgmatic/ssh-key in borgmatic to point borg at the actual key, but it turns out SSH tries the agent keys first. In practice, this means:

matthijs@lurch:/etc/containers/systemd/borgwarehouse$ sudo borgmatic repo-create -e keyfile
Remote: Received disconnect from 127.0.0.1 port 2223:2: Too many authentication failures
Remote: Disconnected from 127.0.0.1 port 2223
Connection closed by remote host. Is borg working on the server?

If I run SSH with -v, it shows:

debug1: Will attempt key: [redacted] agent
debug1: Will attempt key: [redacted] agent
debug1: Will attempt key: [redacted] agent
debug1: Will attempt key: /etc/borgmatic/ssh-key [redacted] explicit
debug1: Offering public key: [redacted] agent
debug1: Authentications that can continue: publickey
debug1: Offering public key: [redacted] agent
Received disconnect from 127.0.0.1 port 2223:2: Too many authentication failures
Disconnected from 127.0.0.1 port 2223

Which confirms this.

I think this might also be the issue underlying #365.

Suggested solution
Raise the the MaxAuthTries config (maybe omit it to get the default value of 6).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions