I built my own SSH Manager with Go after rage-quitting an Udemy course š¤Æ
Tired of forgetting which server is which? I built my own SSH Manager in Go to keep track of my 60+ servers⦠because apparently, Udemyā¦
Tired of forgetting which server is which? I built my own SSH Manager in Go to keep track of my 60+ servers⦠because apparently, Udemy doesnāt teach āDonāt Lose Your Servers 101ā.
Hi, everyone! This is also my first post on Medium, so please, be kind. š
I have like ~60 ssh connections, and they are all messed up, I forgot names, hosts, and so on⦠Already tried a few other programmes like Server Cat and Terminus. ā But⦠I canāt rely on them with my production servers. I need something easy to use and to helps me find what Iām looking for.
*SSH*āāāitās just a way to connect to the servers (in few words)
So I started looking for a course about GO on Udemy, found one (it wasnāt so hard)! The next step was to start learning the basics of the language. ā That took me a few days (4ā5 hours of content). OK, itās all done now.
Because I know what I want to build, now I need to know how to do this and what to use to do that.
1.First of all, I didnāt learn anything from Udemy. š¤§
Why? Because watching a video itās easy and maybe a good way to memorize some shits, but not enough to actually understand whatās going on.
2. Back to 0, F*** that course.š š
ChatGPT? the perfect choice for this job. Letās chat for a bit. After a few messages, he understands what I need and what I wanna do. Looking to give me a start for this one, and I got one. Reading from the config file from ā~/.sshā to get the serverās list. Letās run the code: go run main.go
Output? š

3. Need to make it beautiful and readable āŗļø
After a few searches I found a package named ātablewriterā. Lost like 10 minutes to learn how to add this one to my project, but all good. go.mod itās like composer.json from PHP. Added also the identity, which is the key used for authorization.
Result ā¬

4. Search for the right server and select it š¤¤
Ok, now I need a why to display what I need and to be able to select it. After some googling and ChatGPT, I found a library called ābufioā that can help me with the selection part by creation a prompt that waits for an input by the user to continue the program. For the searching part, I ended up with a simple solution that verifies if the host contains the characters specified by the user.

5. Connecting to server and voilĆ š
The most easier part for this project. We just need to make ssh host.com be called from our project.
Letās run the application one more time: sshm
Final Result!!!
That being said, thatās the program! š„°
I donāt know if you need it or not, maybe not, but I already have a working version on GitHub and new features that I want to add in future versions of this small project.
If you wanna check the code or to contribute with your own ideas, please feel free to check https://github.com/vladutt/sshm and if you wanna correct something⦠be my guest. Iām happy to learn new tricks. š
Why am I sharing that with you? To show how easy itās to learn something new those days, but I said to LEARN, not to copy whatās ChatGPT reply. Itās a big difference between learning and copying from ChatGPT.
I also learn to make automatic releases on GitHub for Windows arm and amd, macOS with and without Apple silicon and for Linux users as well. ^^
And yes, I have more than 60 servers in my ssh config. š
