Multiple ssh connections should really just be managed using Ansible.
I doubt this was meant for linux…
It is. You cant get ssh to print out a nice list afaik.
I can (and do) just read the ~/ssh/.config
file if needed, it’s quite legible. In most cases however zsh autocompletion does all the heavy lifting for me (ssh ser(tab) -> ssh servername
).
Still a cool idea for a script, and if it works well for you more power to you, just saying there’s more ergonomic and universally applicable solutions. (Only mentioning this since you said “I couldn’t find a decent solution to this problem”).
You have a list of systems you’ve connected to in known_hosts, though. And the config file is easy enough to parse - throwing away the stuff you don’t care about - to expand on that list.
Great attempt on making a tool, I think your usecase might not be as appealing to others. If I need to list the hosts I have config for I would use: grep Host ~/.ssh/config If your list of servers is too long to remember, you might want to look at Ansible for configuration. But whatever works for you :)
Wrap a nice ssh config manager around kitty ssh https://sw.kovidgoyal.net/kitty/kittens/ssh/ and it’d be pretty slick