I am writing a VM deployment tool that needed to start VMs on an ESXi server. To do this I am using Perl's Expect module to spawn an ssh client to connect to the server and use vim-cmd to manage the VM.
When I did this I would see the connection and authentication succeed (i.e. the password prompt would be shown, the password accepted and then the prompt would be returned.
Immediately after that the ssh client process outputs "Connection to xxxx closed" and my script stops.