Skip to content

Commit fd6efb7

Browse files
authored
ssh_config: ignore pre-existing SSH keys on client (#14646)
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.
1 parent a5b30cd commit fd6efb7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

roles/ssh_tunneling/templates/ssh_config.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Host algo
22
DynamicForward 127.0.0.1:1080
33
LogLevel quiet
44
Compression yes
5+
IdentitiesOnly yes
56
IdentityFile {{ item }}.ssh.pem
67
User {{ item }}
78
Hostname {{ IP_subject_alt_name }}

server.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
HostName {{ IP_subject_alt_name }}
3333
User {{ ansible_ssh_user }}
3434
Port {{ ansible_ssh_port }}
35+
IdentitiesOnly yes
3536
IdentityFile {{ SSH_keys.private | realpath }}
3637
KeepAlive yes
3738
ServerAliveInterval 30

0 commit comments

Comments
 (0)