59
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 13 Nov 2023
59 points (90.4% liked)
Linux
48033 readers
784 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
It is. You cant get ssh to print out a nice list afaik.
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 :)
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.
I could add a import from known_hosts option or something like that
I assume you mean "lookup", as import doesn't really make much sense.
I'm currently using this with wofi, though I'll eventually rewrite it as anyrun plugin, which provides a bit more control: