News for hackers. Stuff that matters.
Re:Getting Comfortable With SSH by __david__ on Saturday February 05, 2011 @04:23PM (#2184111)
I liked the article but I thought he spent too much time on getting the hostname short. Just install bash_completion and then all ssh/network stuff starts completing based on your known_hosts. His "annoying.hostname.example.com" becomes "ssh ann<tab>" which is still shorter than anything he had there.

I'm glad he did mention my favorite config file option for setting the username:

    Host example.com
      User = someweirduser
That way I don't have to remember to "ssh [email protected]" because some client set up a weird user for me--I just "ssh example.com" instead.
Re:Getting Comfortable With SSH by mcmatterson on Saturday February 05, 2011 @05:10PM (#2184229)
Small point: the syntax of .ssh/config doesn't use equal signs; the actual format of that stanza would be

  Host example.com
  User someweirduser
Another subtle point about SSH config -- only the first matching entry (in top-to-bottom order) for a given parameter is taken from .ssh/config. If you have multiple Host entries that match for a given hostname, the first matching User, Port, etc, entry will be the one that ssh uses.
Re:Getting Comfortable With SSH by jcsalterego on Saturday February 05, 2011 @04:31PM (#2184138)
Yeah, the example is more for hyperbolic illustration than anything else. My actual use case is that I've got a lot of IP addresses, different usernames and non-standard ports across various servers, so it's incredibly convenient to have my .ssh/config all set up.

With aliases (and zsh completion support for aliases), I can do "ann<tab>" which saves me even more time.

It won't be long before all I have to type is tab :)

Re:Getting Comfortable With SSH by thristian on Saturday February 05, 2011 @09:21PM (#2184690)
Modern versions of ssh support the "HashKnownHosts" file which prevents people from discovering what hosts you have ssh'd to in the past - and, as a side effect, prevents tab-completion from discovering what hosts you have ssh'd to as well. ssh_config(5) says the option is disabled by default, but Ubuntu at least enables it in /etc/ssh/ssh_config.