This is an example of setting up a Ubuntu 18.04 and a GDM3 installation to allow test users the ability to click on ssh links to automatically login to docker containers running on the users local system.
I used a vagrant file here for testing, you can use it via the following commands.
Note I tested with vagrant and virtualbox, see your OS's results on installing them.
git clone [email protected]:1778440802dcc250b9560be55fff5f44.git docker_ssh
cd docker_ssh
vagrant up
This box is from the UK, you need to change the region if you want to type special commands like '@' on a US keyboard.
I have included some example scripts that will configure the system via Puppet. The gist of these scripts is that they will configure users that have pass through scripts as shells. These pass through scripts will log them into docker via docker exec
. This along with the URL handler allows the user to simply click on the right link to get the right container. It should work with any app that works with the xdg style apis e.g. from the commandline xdg-open ssh://scenario1@localhost
. I have
included an example HTML file with the links.
- Login to the vagrant box (password
vagrant
) - Open a terminal and type
cd /vagrant
- As the current user (vagrant) type
./setup.sh
- Open the
example.html
and click on the links.
This will install Puppet and run the configuration (with sudo) as needed for all the global configurations and the per-user configurations.
I kept the provisioning manual here as vagrant is not this examples final home. The puppet code should provide an overview of what resources and connections are needed here e.g. ssh keys for localhost.
Software | Version |
---|---|
Ubuntu | 18.04 |
Puppet | 6.21.0 |
Docker | 18.0.9 |
Vagrant | 2.2.14 |
VirtualBox | 6.1.16 |