Skip to content

Commit

Permalink
ssh_config: ignore pre-existing SSH keys on client (#14646)
Browse files Browse the repository at this point in the history
sshd limits the number of authentication attempts permitted per
established connection.
The limit is set via the MaxAuthTries option and defaults to six
attempts.

Client SSH environments that define more than six SSH keys globally or
in the agent would exhaust authentication attempts before they reach the
algo-specified per-instance SSH private key.

SSH client allows "forgetting" existing keys per connection using the
IdentitiesOnly option.
A client only offers an explicitly defined key when this option is set.
  • Loading branch information
realdimas authored Sep 27, 2023
1 parent a5b30cd commit fd6efb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/ssh_tunneling/templates/ssh_config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Host algo
DynamicForward 127.0.0.1:1080
LogLevel quiet
Compression yes
IdentitiesOnly yes
IdentityFile {{ item }}.ssh.pem
User {{ item }}
Hostname {{ IP_subject_alt_name }}
1 change: 1 addition & 0 deletions server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
HostName {{ IP_subject_alt_name }}
User {{ ansible_ssh_user }}
Port {{ ansible_ssh_port }}
IdentitiesOnly yes
IdentityFile {{ SSH_keys.private | realpath }}
KeepAlive yes
ServerAliveInterval 30
Expand Down

0 comments on commit fd6efb7

Please sign in to comment.