News for hackers. Stuff that matters.
Re:Show HN: I made an SSH tunnel manager to learn Go by LifeOverIP on Wednesday October 09, 2024 @11:51AM (#41789267)
I'm curious what are some prototypical use cases for you to embed an ssh sever into an application?
Re:Show HN: I made an SSH tunnel manager to learn Go by hiAndrewQuinn on Wednesday October 09, 2024 @12:12PM (#41789559)
This is scratching the tip of the iceberg, but I use it a lot to get coarse-grained diffs of what's installed on the various Debian servers I administer: https://github.com/hiAndrewQuinn/meikkalainen

The idea is you point it at a server and run `meikkalainen [email protected]`, just like you would for a normal SSH command, and what you get is a nice tidy JSON dump of everything it has installed, what kernel modules it's running, etc. I keep meaning to get around to writing a semantic diff between 2 such JSON files, so I can notice subtle things like "Hey, this Debian 12 has a slightly upgraded xyz compared to this Debian 12, what gives?"

The fact Go compiles down to a single binary, and without too much effort a totally self-contained one I can just scp and run wherever I need it, is another plus for this kind of thing. It just feels so much better than the `paramiko` or whatever equivalent might be.

I'm somewhat a victim of my own success here. After writing this several months ago I have inadvertently made myself feel much more confident working with Debian versus other, shinier Linux distros, even though they often come with benefits that hopefully make this kind of fringe sysadmin work irrelevant. (Until it becomes relevant in a new form later...)

Re:Show HN: I made an SSH tunnel manager to learn Go by devsda on Wednesday October 09, 2024 @12:36PM (#41789844)
Going through the code, I couldn't find a server but only usage of ssh client. May be I missed it. But I think GP was looking for usecases where its helpful to run an embedded ssh server using a go binary.

Ansible facts can probably be a cross platform way to collect most of the information you need. For the usecases where scp'ng the binary is needed, I think ansible supports jumphost config too. But I agree that for one off tasks, running a single binary is convenient compared to setting up ansible.

Re:Show HN: I made an SSH tunnel manager to learn Go by hiAndrewQuinn on Wednesday October 09, 2024 @12:41PM (#41789898)
Oop - you're right, I missed that they wanted server examples specifically. Thanks for the save.
Re:Show HN: I made an SSH tunnel manager to learn Go by justsid on Friday October 11, 2024 @02:53AM (#41806956)
I work for a C++ company but the game we work on has a debug telnet server. It’s super useful to inspect state or even run automation scripts. Also has a bunch of useful debug commands like the ability to live reload shaders or change how various subsystems work.