News for hackers. Stuff that matters.
Re:Show HN: S – a tool for ssh like z for cd by jethro_tell on Sunday March 01, 2015 @06:14PM (#9129352)
It'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.

Re:Show HN: S – a tool for ssh like z for cd by dhagz on Sunday March 01, 2015 @08:06PM (#9129746)
Are 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.
Re:Show HN: S – a tool for ssh like z for cd by voltagex_ on Sunday March 01, 2015 @09:29PM (#9130003)
My 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=7658459

Some stuff changed in OpenSSH 6+ so read the manpages, too.

Re:Show HN: S – a tool for ssh like z for cd by bdarnell on Sunday March 01, 2015 @09:58PM (#9130100)
There 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.
Re:Show HN: S – a tool for ssh like z for cd by wampus on Sunday March 01, 2015 @11:19PM (#9130309)
I version control the entire directory (ignoring the known_hosts file) somewhere like ~/config/ssh and symlink it to ~/.ssh. It contains a Makefile with a target that runs this command:

    ln -s ${PWD} ~/.ssh
Just make sure the directory is chmod 700 and the important files in it are chmod 600.
Re:Show HN: S – a tool for ssh like z for cd by jethro_tell on Monday March 02, 2015 @12:28AM (#9130441)
Also ignore any private keys. For security, but also each host should have a different key so you can burn one without burning them all.
Re:Show HN: S – a tool for ssh like z for cd by voltagex_ on Sunday March 01, 2015 @10:06PM (#9130120)
Oops! Thanks for the clarification
Re:Show HN: S – a tool for ssh like z for cd by eranation on Sunday March 01, 2015 @10:35PM (#9130198)
Yep. 100% with you on that one. And it's not that hard to setup. I found this as a great resource: http://nerderati.com/2011/03/17/simplify-your-life-with-an-s...
Re:Show HN: S – a tool for ssh like z for cd by wampus on Sunday March 01, 2015 @11:29PM (#9130336)
Just 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.
Re:Show HN: S – a tool for ssh like z for cd by _jomo on Sunday March 01, 2015 @04:58PM (#9129064)
This is nice, but I also like the way fish (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>`

Re:Show HN: S – a tool for ssh like z for cd by jamiesonbecker on Sunday March 01, 2015 @05:03PM (#9129086)
fwiw, 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.
Re:Show HN: S – a tool for ssh like z for cd by philippnagel on Sunday March 01, 2015 @06:18PM (#9129370)
General thumbs up for Fish!
Re:Show HN: S – a tool for ssh like z for cd by chainsaw10 on Sunday March 01, 2015 @04:34PM (#9128989)
I 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

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.

Re:Show HN: S – a tool for ssh like z for cd by jethro_tell on Sunday March 01, 2015 @06:12PM (#9129340)
> but this doesn't require setup per server.

Well you have to ssh to the serer a few times?

Re:Show HN: S – a tool for ssh like z for cd by TheDong on Sunday March 01, 2015 @11:26PM (#9130329)
fasd, https://github.com/clvv/fasd, is a superior z. I'd recommend that highly over the above linked 'z'.
Re:Show HN: S – a tool for ssh like z for cd by jamiesonbecker on Sunday March 01, 2015 @05:06PM (#9129100)
Userify 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/

Re:Show HN: S – a tool for ssh like z for cd by haosdent on Sunday March 01, 2015 @10:08PM (#9130126)
I think we could add rank like this:

Host xxx

    Rank 2
Re:Show HN: S – a tool for ssh like z for cd by chrift on Monday March 02, 2015 @05:47AM (#9131248)
Wouldn't you just use vssh and be done with it? http://www.velestar.com/Pages/VSSHOSXPage.aspx

Or am I missing the point?

Re:Show HN: S – a tool for ssh like z for cd by shadeless on Sunday March 01, 2015 @03:57PM (#9128860)
Nice! I use warp [0] to manage ssh hosts, but I could see myself using this too.

[0] https://github.com/jpalardy/warp

Re:Show HN: S – a tool for ssh like z for cd by haosdent on Sunday March 01, 2015 @10:04PM (#9130113)
Looks nice!
Re:Show HN: S – a tool for ssh like z for cd by fasteo on Monday March 02, 2015 @05:52AM (#9131264)
I usually do "CTRL-r ssh" to accomplish this. Maybe not as complete, but enough for me.
Re:Show HN: S – a tool for ssh like z for cd by jamiesonbecker on Sunday March 01, 2015 @05:01PM (#9129073)
this 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?
Re:Show HN: S – a tool for ssh like z for cd by haosdent on Sunday March 01, 2015 @09:14PM (#9129948)
Let me try :-)
Re:Show HN: S – a tool for ssh like z for cd by haosdent on Sunday March 01, 2015 @08:55AM (#9127028)
s is a tool for ssh like z for cd
Re:Show HN: S – a tool for ssh like z for cd by p4lindromica on Sunday March 01, 2015 @10:14PM (#9130146)
just like there is .ssh/config for ssh, there is $CDPATH for cd.