An open source, MIT-licensed command line tool for managing per-project ssh configs.
ssh allows the use of a config plaintext file, usually located in ~/.ssh/config, that allows you to customize ssh in a whole host (heh) of ways. One primary use is the creation of aliases for hosts.
However, a single global config file for ssh can quickly become unwieldy and messy (motivating stack exchange).
A CLI to manage your global ssh config and to allow for per-project configurations.
Lassh requires Python 3. Run pip install lassh. If you haven't already, check out pyenv for python version management and pipenv for dependency management, though they aren't neccesary for using Lassh.
cdinto your project (or lab or class or secret government R&D group) directory that you want to configure ssh for.
lassh initwill create a global config and a projectlassh.config(if they don't already exist). Note:lassh.configfiles are valid plaintext.ssh/configfiles. Lassh will then link your new or existinglassh.configto the global config! But you don't have any new hosts to connect to...
lassh addhost beepboop computer.dartmouth.edu stevenchunadds a host now calledbeepboopthat points tostevenchun@computer.dartmouth.edu. You can also specify a path to identity keys using the--keyoption and a port with the--portoption. If you leave the user out, it will default toroot.
It's important to remember that while Lassh allows you to distribute your config files, the ssh alias namespace is global so you can't have the same alias in two different lassh.config files.
lassh deletehost beepboopdeletes the host we just made from our locallassh.config. (It does not remove the link from our projectlassh.configto the global config)
lassh teardownunlinks and deletes thelassh.configin the current directory from the global config. Warning: this deletes all aliases you have in the project'slassh.config
Since each lassh.config is a valid ssh config file, if you want to add an option like LocalForward, simply add the host and manually edit the lassh.config file to add more options (or contribute to add the relevant feature to Lassh!!).
Tests can be run using python -m unittest test.test_lassh while in the lassh python package directory.