Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Too many authentication failures #21

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

b4ldr
Copy link
Member

@b4ldr b4ldr commented Dec 19, 2019

By default ssh will try all keys stoered in the ssh agent when
connecting to a server. If a agent has many keyes loaded it can leed to
the server responding with the following error before the
username/password pair is tried:

Net::SSH::Disconnect - disconnected: Too many authentication failures

This PR updates the ssh config to use :keys_only which translates to the
ssh confi IdentitiesOnly

@puppetlabs-jenkins
Copy link
Contributor

Can one of the admins verify this patch?

@sbeaulie
Copy link
Contributor

test this please

@@ -224,6 +224,7 @@ def provision
:password => root_password,
:port => port,
:forward_agent => forward_ssh_agent,
:keys_only => 'yes',
Copy link
Contributor

@sbeaulie sbeaulie Dec 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @b4ldr. It seems to me that we are using username/password to authenticate the SSH connection, so disabling looking through the ssh-agent for keys makes sense. My worry is that if anyone is using ssh-agent to connect, this would break it. Another solution would be to set the "auth_methods" to change the order and try the password method first, like so:

Suggested change
:keys_only => 'yes',
:auth_methods => ['password', 'publickey', 'hostbased', 'keyboard-interactive']

from https://net-ssh.github.io/ssh/v1/chapter-2.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, updated

By default ssh will try all keys stoered in the ssh agent when
connecting to a server.  If a agent has many keyes loaded it can leed to
the server responding with the following error before the
username/password pair is tried:

  Net::SSH::Disconnect - disconnected: Too many authentication failures

This PR updates the ssh config to use change the `:auth_methods` order
so password authentication is prefered
@b4ldr
Copy link
Member Author

b4ldr commented Jan 23, 2020

bump: this has been updated as per the recomendation thanks

@sbeaulie sbeaulie merged commit 25b1470 into voxpupuli:master Jan 23, 2020
@sbeaulie
Copy link
Contributor

Thank you for your contribution, I will release it today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants