5 ms·
Show HN: S – a tool for ssh like z for cd
- haosdent 12y agos is a tool for ssh like z for cd
- p4lindromica 12y agojust like there is .ssh/config for ssh, there is $CDPATH for cd.
- shadeless 12y agoNice! I use warp [0] to manage ssh hosts, but I could see myself using this too. [0] https://github.com/jpalardy/warp https://github.com/jpalardy/warp
- haosdent 12y agoLooks nice!
- chainsaw10 12y agoI had to look up what z for cd was, so to save others the trouble, here's a link (hopefully the original...): https://github.com/rupa/z https://github.com/rupa/z SSH hosts tend to be long, so this seems like a good idea. I realize the .ssh/config exists, but this doesn't require setup per server.
- jethro_tell 12y ago> but this doesn't require setup per server. Well you have to ssh to the serer a few times?
- TheDong 12y agofasd, https://github.com/clvv/fasd https://github.com/clvv/fasd, is a superior z. I'd recommend that highly over the above linked 'z'.
- _jomo 12y agoThis is nice, but I also like the way fish (http://fishshell.com/ http://fishshell.com/) handles auto-completion: When I type `ssh<tab>`, I get a list of hosts from my ~/.ssh/config plus hosts I have previously used. I can actually use `ssh hn<tab>` and it gets auto-completed to `ssh hostname` because "hostname" is configured in my ssh config. The same works for `ssh user@<tab>`
- jamiesonbecker 12y agofwiw, bash autocompletion does this automagically, too, but you might need to enable it. .ssh/config is definitely the canonical place to keep this stuff, but I like @haosdent's ranking concept. some of my boxes I rarely log into, and others I log into all the time.
- philippnagel 12y agoGeneral thumbs up for Fish!
- jamiesonbecker 12y agothis is fantastic work @haosdent - I'm working on adding automatic .ssh/config generation to Userify shortly. Could this read .ssh/config and build initial db for that?
- haosdent 12y agoLet me try :-)
- jamiesonbecker 12y agoUserify supports jump box creation[1] (automatic .ssh/config coming soon as well) and with bash autocompletion, you can hit any host in .ssh/config. Is there any way to add ranking variables to .ssh/config that a regex or autocompletion script like this could read but plain SSH would ignore? 'bad configuration option' if I stick in an unrecognized variable name. Embed in comments? 1. https://userify.com/docs/tips/jumpbox/ https://userify.com/docs/tips/jumpbox/
- haosdent 12y agoI think we could add rank like this: Host xxx Rank 2
- jethro_tell 12y agoIt's amazing to me how many people use ssh and don't have an ssh config. It would be easier to maintain a .ssh folder in version control then to install this on each host and ssh until it learns. Your auto provision of servers with chef or puppet should be adding them to you .ssh/config with a pointer to the ssh key and special requirements like tunnels through jump hosts/ bastion hosts.
- dhagz 12y agoAre there any resources you recommend on maintaining a .ssh folder? I've done a little reading, but I've never really needed to worry about working with multiple servers before, but I'm going to need to learn soon for a project at work.
- voltagex_ 12y agoMy set up dotfiles in a git repo (~/configs) with a Makefile that symlinks them to the correct location. I'm hoping someone chimes in with a bit of a better solution but there's no reason you couldn't have ~/.ssh/config symlinked in the same way. Make sure you know which version/s of ssh you'll be dealing with and make the config work with the lowest version Some HN articles/discussions: https://news.ycombinator.com/item?id=4677049 https://news.ycombinator.com/item?id=4677049 https://news.ycombinator.com/item?id=7658459 https://news.ycombinator.com/item?id=7658459 Some stuff changed in OpenSSH 6+ so read the manpages, too.
- bdarnell 12y agoThere is actually a reason you can't have ~/.ssh/config symlinked the same way: ssh refuses to read a symlink for this file (for security purposes it is strict about the file type and permissions). My workaround is to copy the file instead of symlinking in my dotfile-setup script.
- voltagex_ 12y agoOops! Thanks for the clarification
- deleted 12y ago[deleted]
- wampus 12y agoJust my 2 cents, but I feel strongly that publicly released programs should be named with a minimum of 3 characters, reserving shorter names for user aliases and local commands.
- chrift 12y agoWouldn't you just use vssh and be done with it? http://www.velestar.com/Pages/VSSHOSXPage.aspx http://www.velestar.com/Pages/VSSHOSXPage.aspx Or am I missing the point?
- fasteo 12y agoI usually do "CTRL-r ssh" to accomplish this. Maybe not as complete, but enough for me.