Skip to content

flying-sphinx/redcap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redcap

Redcap was written because I need to track SSH remote forwards by their process id, and all I have is the port they’re forwarding to. You can’t pair the two together unless you have root access, though – and that’s where Redcap comes in. You run Redcap as root, and then you can ask it to do the pairing for you.

Installation

gem install redcap

Usage

As a server, you’ll also want EventMachine installed:

gem install eventmachine

And then, the service must be run as root (so it can get all the requierd port and process information):

$ sudo redcap

And in code, as a client:

require 'rubygems'
require 'redcap'
Redcap.pid_for_port(10342) #=> 26151

Author

Pat Allan wrote this code in May 2011, but all the hard work for daemonising the process, logging, and a pid file was done in a gist by James Healy.

Licence

Released under the MIT Licence. Fork, contribute, re-use, whatever.

About

Translates SSH forward ports to process IDs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages