You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a VM which should have port 22 disabled but still have the SSH daemon listening on another arbitrary port, say 444
I can kitchen create the VM just fine. The kitchen-vagrant driver will use port forwarding 22 => 2222 as per default behaviour.
I then provision the VM. I can therefore kitchen converge the VM just fine over port 22 => 2222. This is where Ansible (or any other provisioner) would configure the SSH daemon inside the VM to not listen on port 22 anymore but listen on port 444 as mentioned above.
From here on, I can no longer SSH into the VM because obviously the 22 => 2222 default port-forwarding would no longer work. The SSH daemon inside the VM is listening on port 444 after its first provisioning.
How can I tell kitchen-vagrant to connect to the VM via port 444?
So far I have tried using the following, either in combination or in isolation, but none of them have worked:
# .kitchen.yml
driver:
name: vagrant
communicator: ssh # whether or not I specify this, it makes no difference
network:
- ["forwarded_port", {guest: 444, host: 444, auto_correct: true}]
# Does not really matter how I define the below, it never works
platforms:
- name: ubuntu-16.04
transport:
name: ssh
port: 444
driver:
port: 444
driver_config:
port: 444
I would expect that if I modify the port settings of the driver, instead of seeing the following:
==> default: Forwarding ports...
default: 444 (guest) => 444 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
I would see the following:
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:444
But that doesn't happen. It's probably also worth mentioning that the automatically generated "test-kitchen state" (I think it's called..) remains the same all the time:
Probably relates to test-kitchen/test-kitchen#1159
I have the following scenario at play:
22
disabled but still have the SSH daemon listening on another arbitrary port, say444
kitchen create
the VM just fine. Thekitchen-vagrant
driver will use port forwarding22 => 2222
as per default behaviour.kitchen converge
the VM just fine over port22 => 2222
. This is where Ansible (or any other provisioner) would configure the SSH daemon inside the VM to not listen on port22
anymore but listen on port444
as mentioned above.22 => 2222
default port-forwarding would no longer work. The SSH daemon inside the VM is listening on port444
after its first provisioning.How can I tell
kitchen-vagrant
to connect to the VM via port444
?So far I have tried using the following, either in combination or in isolation, but none of them have worked:
I would expect that if I modify the port settings of the driver, instead of seeing the following:
I would see the following:
But that doesn't happen. It's probably also worth mentioning that the automatically generated "test-kitchen state" (I think it's called..) remains the same all the time:
But I would expect to see
port: 444
. That doesn't happen either.What am I missing?
Thanks!
The text was updated successfully, but these errors were encountered: