App::PersistentSSH - Kick an F control master around on OSX using


App-PersistentSSH documentation  | view source Contained in the App-PersistentSSH distribution.

Index


NAME

Top

App::PersistentSSH - Kick an ssh control master around on OSX using scutil

SYNOPSIS

Top

	% persisshtent --host your.host.com

DESCRIPTION

Top

This POE component will keep an SSH control master alive, depending on network status.

It uses the OSX command line tool scutil to get notification on changes to the State:/Network/Global/IPv4 configuration key. Whenever this key is changed scutil -r will be used to check if the specified host is directly reachable (without creating a connection using e.g. PPP), and if so spawn ssh.

If the host is not reachable, ssh is stopped.

CONFIGURATION

Top

Add something alongs the lines of

	Host *
		ControlPath /tmp/%r@%h:%p

to your ssh_config, in order to configure the path that the ssh control master will bind on. ControlMaster auto is not needed.

The advantage over ControlMaster auto is that if you close your initial ssh, which is the control master under auto all subsequently made connections will also close. By keeping a daemonized, managed instance of ssh this problem is avoided.

Use ssh -v yourhost to verify that the connection really is going through the control master.

You can create a launchd service for this using http://lingon.sourceforge.net/. I use:

	<key>Disabled</key>
	<false/>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>pasta ssh</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/bin/perl</string>
		<string>/Users/nothingmuch/Perl/App-PersistentSSH/bin/persisshtent</string>
		<string>--verbose</string>
		<string>--host</string>
		<string>pasta.woobling.org</string>
	</array>

ATTRIBUTES

Top

host

The host to connect to. Must be a valid ipaddress/hostname, not just an ssh config host entry.

ssh_verbose

Pass -v to ssh.

ssh_opts

Additional options for ssh, useful for tunnelling etc.

METHODS

Top

new
new_with_options

Spawn the POE component.

new_with_options comes from MooseX::Getopt.

run

Calls run in POE::Kernel.

VERSION CONTROL

Top

This module is maintained using Darcs. You can get the latest version from http://nothingmuch.woobling.org/code, and use darcs send to commit changes.

AUTHOR

Top

Yuval Kogman <nothingmuch@woobling.org>

COPYRIGHT

Top


App-PersistentSSH documentation  | view source Contained in the App-PersistentSSH distribution.