News for hackers. Stuff that matters.
Re:Simplify your life with an SSH config file by icebraining on Saturday October 20, 2012 @11:20AM (#4677257)
A great option to enable for servers where you're constantly SSHing to (either opening a shell or pushing a repo) is ControlMaster, which lets you multiplex a single connection and cut down on the initial connection time (including authentication).
Re:Simplify your life with an SSH config file by VBprogrammer on Saturday October 20, 2012 @11:24AM (#4677266)
Syntax for anyone looking for it:

  Host *
  ControlMaster auto
  ControlPath ~/.ssh/cm_socket/%r@%h:%p
Re:Simplify your life with an SSH config file by ebroder on Sunday October 21, 2012 @03:07AM (#4679198)
If you have a new enough ssh client, I'd personally recommend setting ControlPersist yes.

This fixes the UI wart where your first ssh connection to a server has to stay open for the duration of all your others (or your others all get forcibly disconnected).

It's not perfect. If the name of a server changes but you already have a control socket, it'll use the socket and connect to the old server. And it also takes it a while to pick up networking changes that break your connectivity, though I've hacked around that with a script I keep running in the background (Linux only, at the moment; requires gir1.2-networkmanager-1.0):

  #!/usr/bin/python
  import os
  from gi.repository import GLib, NMClient
  def active_connections_changed(*args):
      for sock in os.listdir(os.path.expanduser('~/.ssh/sockets')):
          os.unlink(os.path.join(os.path.expanduser('~/.ssh/sockets'), sock))
  c = NMClient.Client.new()
  c.connect('notify::active-connections', active_connections_changed)
  GLib.MainLoop().run()
There's some contention with my coworkers about whether ControlPersist is actually desirable given the tradeoffs, but I personally think it's a huge improvement.
Re:Simplify your life with an SSH config file by icebraining on Saturday October 20, 2012 @11:43AM (#4677320)
I'm an apologist of RTFMP, which is why I didn't include it ;)
Re:Simplify your life with an SSH config file by SkyMarshal on Saturday October 20, 2012 @01:41PM (#4677661)
It's generally appreciated anyway, since man pages don't always have examples [1]:

$> man controlmaster

No manual entry for controlmaster

$> man ssh|grep -i controlmaster

required before slave connections are accepted. Refer to the description of ControlMaster in ssh_config(5) for details.

ControlMaster description of ControlPath and ControlMaster in ssh_config(5) for details.

$> man ssh_config|grep -i controlmaster

ControlMaster

with ControlMaster set to “no” (the default). These sessions will try to reuse the master instance's network connection rather than

Specify the path to the control socket used for connection sharing as described in the ControlMaster section above or the string

When used in conjunction with ControlMaster, specifies that the master connection should remain open in the background (waiting for

[1]: http://www.reddit.com/r/fossworldproblems/comments/v7hi1/man...

Re:Simplify your life with an SSH config file by nnq on Saturday October 20, 2012 @11:00PM (#4678798)
...quick and to the point article explaining it, and comments to get you going further with it: http://www.debian-administration.org/articles/290 (I know, it sucks when RTFMP gets you into a sort of dead end...)
Re:Simplify your life with an SSH config file by jperras on Saturday October 20, 2012 @02:51PM (#4677871)
Oh wow, this is great. I had no idea that existed.

Thanks!