ssh-easy.adoc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. [#action-ssh-easy]
  2. = SSH (easy setup)
  3. include::partial$action_examples/ssh_intro.adoc[]
  4. NOTE: This is the easy method of setting up SSH with OliveTin - this generates a new SSH key for you, and a configuration file that disables SSH host key checking, to make it faster to do useful things with OliveTin. This is fine for most homelab setups, but if you are using OliveTin in a production environment, you should use the more secure method of setting up SSH and set it up manually, see xref:action_examples/ssh-easy.adoc[SSH (manual setup)].
  5. == SSH from inside a Container - setup instructions
  6. * [red]#<<ssh-easy-step-1,Step 1>># Use the olivetin-setup-easy-ssh script to generate a new SSH key and configuration file
  7. ** Add this key fingerprint to servers and hosts that you want to SSH to.
  8. * [red]#<<ssh-easy-step-2,Step 2>># Setup actions that use SSH with this configuration file (which points to the key)
  9. Visually, this is what it looks like - OliveTin is running in the (orange) container, and then can either connect back to _server-with-olivetin_ or _server2_.
  10. image::../ssh-diagram.png[]
  11. [#ssh-easy-step-1]
  12. == [red]#Step 1#: Run the olivetin-setup-easy-ssh script
  13. Setup an action as follows, to use the builtin olivetin-setup-easy-ssh script that comes with OliveTin containers. This script does **not** work on Windows, MacOS, or outside of a container.
  14. .config.yaml
  15. [source,yaml]
  16. ----
  17. actions:
  18. - title: Setup SSH
  19. shell: olivetin-setup-easy-ssh
  20. onclick: execution-dialog
  21. ----
  22. [#ssh-easy-step-2]
  23. == [red]#Step 2#: Use the configuration file in your actions
  24. To use the configuration file generated by the script, you can use the following in your other actions:
  25. .config.yaml
  26. [source,yaml]
  27. ----
  28. actions:
  29. - title: SSH into a server
  30. shell: ssh -F /config/ssh/config root@myserver '/opt/script-on-my-server.sh'
  31. ----