tart icon indicating copy to clipboard operation
tart copied to clipboard

tart ssh

Open tomjn opened this issue 3 years ago • 3 comments

A command to open an SSH session with a named Tart VM, with optional authentication parameters

e.g.

tart ssh ubuntu

This is assuming the guest VM is already configured for SSH access, which may require user intervention.

It would also be useful to pass a command as an argument that then runs and exits, perhaps passing back a return code, e.g.

tart ssh ubuntu --command "echo 'hello world'"

tomjn avatar Nov 04 '22 15:11 tomjn

Note that some of the rationale would be to allow programs like Vagrant to log in easily. For Vagrant's preconfigured boxes, they are usually configured with a default admin user like vagrant with password vagrant, and SSH is set up to run on port 22 by default. macOS can even be configured to run SSH the same way, which is highly convenient for those of us who enjoy automating macOS with Ansible ;)

geerlingguy avatar Nov 04 '22 21:11 geerlingguy

Does ssh ubuntu@$(tart ip ubuntu) work for you?

fkorotkov avatar Nov 06 '22 00:11 fkorotkov

That's a promising start. For vagrant at least we'll want to be sure we can put a vagrant user in the VM before running this and that an SSH daemon is running and inside the VM, I imagine we'd do this via packer? Does the Tart packer fork play well with non MacOS VMs?

This is probably going to be the easiest route to running provisioners in Vagrant beyond the scripts to build an images/boxes that get packaged

tomjn avatar Nov 06 '22 02:11 tomjn

Since Tart itself is not storing information about user/password configured inside the VM, we can't do tart ssh and an integration will need to take care of it.

fkorotkov avatar Feb 05 '23 15:02 fkorotkov