Skip to content
New issue

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

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

Already on GitHub? # to your account

Update connection settings when using a password to connect ssh #13052

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

soapy1
Copy link
Contributor

@soapy1 soapy1 commented Jan 9, 2023

When connecting over ssh using net-ssh use the non_interactive argument must be set when authenticating with a password.

The "keyboard-interactive" options may be used as a default auth method, like in the net-ssh defaults (ref: https://github.com/net-ssh/net-ssh/blob/8a176a6ea0db1b59a21834df806a257a0b76e943/lib/net/ssh/config.rb#L52)

fixes #13008

@soapy1 soapy1 marked this pull request as ready for review January 9, 2023 21:44
@soapy1 soapy1 marked this pull request as draft January 10, 2023 01:10
@soapy1 soapy1 force-pushed the password-auth-ssh branch from ce3f503 to 040c79e Compare January 10, 2023 17:32
@soapy1 soapy1 marked this pull request as ready for review January 10, 2023 17:32
@soapy1 soapy1 force-pushed the password-auth-ssh branch from 040c79e to 40ee332 Compare January 10, 2023 20:33
chrisroberts
chrisroberts previously approved these changes Jan 30, 2023
When connecting over ssh using net-ssh use the non_interactive
argument must be set when authenticating with a password.

Add the keyboard-interactive default auth method
ref: https://github.com/net-ssh/net-ssh/blob/8a176a6ea0db1b59a21834df806a257a0b76e943/lib/net/ssh/config.rb#L52
@soapy1 soapy1 merged commit bc1e00f into hashicorp:main Feb 22, 2023
@legal90
Copy link
Contributor

legal90 commented Mar 22, 2023

@chrisroberts @soapy1 Hi! This PR has is causing the unexpected behavior in vagrant-parallels provider. Our provider's method ssh_info returns nil at the early stage, when the VM has just started, but didn't receive its IP yet:

https://github.com/Parallels/vagrant-parallels/blob/93aac8af8c63820b6d67b4487413e78218b1caac/lib/vagrant-parallels/provider.rb#L66-L68

We expect that the next attempt in 1-2 seconds will be successful.
But after this PR it's asking for a password instead of retrying:

$ bundle exec vagrant up
Bringing machine 'default' up with 'parallels' provider...
==> default: Registering VM image from the base box 'test-centos'...
==> default: Creating new virtual machine as a linked clone of the box image...
==> default: Unregistering the box VM image...
==> default: Setting the default configuration for VM...
==> default: Setting the name of the VM: vagrant-parallels_default_1679487998890_21336
==> default: Preparing network interfaces based on configuration...
    default: Adapter 0: shared
==> default: Clearing any previously set network interfaces...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: :22
    default: SSH username: vagrant
    default: SSH auth method: private key
Password:

Is that the expected behavior now, so we should handle that properly on the parallels provider side? Or maybe we can just fix that here, in vagrant?

legal90 added a commit to Parallels/vagrant-parallels that referenced this pull request Mar 22, 2023
- Pin `vagrant` to the latest release tag `v2.3.4`. Current `main` branch has unreleased changes which brakes our
acceptance tests. Ref: hashicorp/vagrant#13052 (comment)

- Pin `vagrant-spec` to a PR branch, which contains the fix for Ruby 3.0 runtime:
hashicorp/vagrant-spec#56
legal90 added a commit to Parallels/vagrant-parallels that referenced this pull request Mar 22, 2023
- Pin `vagrant` to the latest release tag `v2.3.4`. Current `main` branch has unreleased changes which brakes our
acceptance tests. Ref: hashicorp/vagrant#13052 (comment)

- Pin `vagrant-spec` to a PR branch, which contains the fix for Ruby 3.0 runtime:
hashicorp/vagrant-spec#56
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2023
@chrisroberts
Copy link
Member

@legal90 Hi! Sorry for the delay on circling back around to this. I'm walking through the behavior here and the behavior described in the original issue it was meant to address. The resulting behavior does not appear to be ideal and I'll be making some modifications that will be up in a new PR shortly.

@chrisroberts
Copy link
Member

PR here: #13194

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vagrant not using password even if password authentication is set
3 participants