Ask HN: Developers, how do you keep SSH and web URLs organized at work?
So I'm sure many of you have dozens of web application URLs across multiple development, QA, production environments and as many URLs for tools and SSH endpoints you use all the time.
My system for keeping all this organized is to sift through bash history and browser history and abortive attempts at keeping Excel spreadsheets or Evernote pages full of this stuff.
Does anyone have any pointers for tools they like to make this easier?
Thanks!
101 comments
[ 3.4 ms ] story [ 127 ms ] threadSSH: ~/.ssh/known_hosts and ~/.ssh/config
Web URLs - Use bookmarks or write yourself a small local html file with a bit more organisation. Or use a text file with an editor that makes it easy to Cmd+Click a link.
Less simple, but great for teams, use a wiki page with the appropriate links.
For SSH endpoints, I more or less have everything aliased in my ~/.ssh/config file. If it's just a server, I can just ssh hostname. If it's a host I'm doing port forwarding on, I'll have it aliased to ssh hostname-tunnel or ssh hostname-SOCKS5.
There used to be a "Domain Switcher" extension for Firefox, but it doesn't seem to work in a post-Quantum world. Chrome has such a addon: https://chrome.google.com/webstore/detail/domain-switcher/lb...
An example of an overlay, though not aimed at environments specifically:
https://plus.google.com/104092656004159577193/posts/ASRaMF5x...
https://pastebin.com/raw/eFQrTJaY
For ssh I just use bash history, but I don’t have a ton of environments
[0] https://www.digitalocean.com/community/tutorials/how-to-conf...
Cygwin does a good job with the ssh config file on Windows, if anyone is looking for tool suggestions.
This wasn't in OPs question, but have to add that if possible, put your SSH keys in the servers known_hosts file and you can have secure passwordless login, which combined with the ssh config file on your machine is fantastic. I just do "ssh $SERVER" in cygwin, where $SERVER is my defined alias pointing to an IP, and that's it. Takes literally five seconds.
[0] https://github.com/moul/advanced-ssh-config
Ssh - ssh config named as <system>_<environent>
rest APIs - postman collections by system
Although, my work recently took away direct SSH access for all devs in all environments, we now have to SSH to a bastion host, then SSH to servers from there. Makes my ssh config less valuable.
You can configure custom url handlers so that it opens the terminal then ssh right in the server you clicked on.
With a firefox extension, it let you autofill credentials.
Simple one file to backup or sync. Always encrypted. Crossplateform. Free software. Robust. Proven. And a Fugly UI that looks corporate enough for you pointy hair boss.
The only thing missing is that I'm using a cmd otp generator for one time passwords, but it doesn't have keepass support yet.
Otherwise pointy hair boss will bitch.
When in doubt, write it down, preferably somewhere secure to prevent leaking anything if handling sensitive data. Excel spreadsheets work pretty well too, but formatting might get a bit distracting.
At a previous job we ran a lot of client-facing servers and kept most of the URLs in our server monitoring software. It wasn't great and there wasn't a lot of documentation, but frequently accessed servers were all in a central place (save for our test/Ansible servers).
Windows: mRemoteNG
Linux: Gnome connection manager
Mac: Iterm 2 profiles (any better options?)
https://linux.die.net/man/5/ssh_config
I built a database on AWS DynamoDB + API Gateway which has the "url" information. Also many other things, like which newrelic accounts are used by each environment. This is intended to be used by automation, but humans can just curl | jq these.
That said, SSH access (by humans) should be very rare. If you have to SSH to a production system, ask yourself what is it that you are trying to accomplish, and would you still be doing that if you had another tool to accomplish the same operation?
I've never really understood how you should keep SSH keys. I kept them all in a folder and set zsh to iterate through them all and run ssh-add on startup. Until I realised it can't cope after adding a certain amount, now I'm back to manually doing it.
For URLs, I use bookmarks, that's it. You might actually need more, or you might think you might need more :D but I don't think so.
Also different URL collections have different places, for example I collected all our developer documentation URLs in a single wiki (Confluence) page with a permalink and put it under an easy-to-remember internal domain.
1) As others have already written, I use ssh config to organize the urls and have simpler host names.
2) I use 2/3 letter codes as aliases which ssh into the specific host.
For ex- Environment - tool
sw = staging webserver pw = production webserver pj = production jenkins.
This allows me to open a new terminal window and type 2/3 characters to ssh into a box.
I find chrome bookmarks sufficient for my website bookmarks. They sync across computers and can be organized in folders.