Git Product home page Git Product logo

regme's Introduction

Regme has been depreciated for https://github.com/inanimate/induction

Welcome to regme...

The Problem

Regme is a ssh-agent socket manager for forwarded ssh keys on a host. I ran into problems at work where when using a private key (with a passphrase) was great... except for when you start using a virtual terminal.

What is needed

In order to keep a socket alive that your virtual terminal can keep utilizing, some management is necessary to ensure your terminals always have an updated and alive socket to use.

How it works

Here's the premise: We utilize a symlink as our main socket that all shells know about all the time. We then modify this symlink depending on the socket we want to use. For remote servers, we end up utilizing ssh-agent and loading our key there and then setting our shells to use it. If we end the ssh-agent process, we want the symlink to point to our current socket that was/is created at our/every ssh login.

This is awesome because it enables us to leave scripts running that utilize authentication whilst not logged into the server!

You can probably read through some of regme and get a pretty good grasp of whats going on here.

What you need
  1. A linux box with ssh-agent installed (never seen one with out it).
  2. A home directory with obvious write perms.
How to use it
  1. Copy the rc file to ~/.ssh/
  2. Add the contents of .zshrc to your .zshrc/.bashrc file.
  3. Copy regme somewhere and edit the top of the file...specifying the ssh key to load into ssh-agent and the locations for the symlinks (i store em in my homedir)
  4. Run the regme script whenever you want to "register" yourself on the box! This will essentially check if you are already registered, and if not, launch ssh-agent, setup your symlink to point to the new socket, and run ssh-add with the key you want added.

Usage: regme.sh [kill | ?/-h/help]

Running the script with 'kill' will kill ssh-agent.

More on this

More on the details of this and some of the original code here: http://scriptthe.net/2013/09/11/seriously-managing-ssh-forwarding-in-virtual-terminals-and-beyond/

regme's People

Contributors

inanimate avatar

Watchers

James Cloos avatar  avatar

regme's Issues

ssh_auth_sock_rem symlink doesn't stay updated with current shell

If you log into your server, this gets properly pointed to your current socket. If you log in again, a new socket is created for that session and the symlink is replaced with the new socket (for the second session).

Now, if that second session is exited, that socket gets destroyed but the symlink still points to it. So if you go back to using the first session, and then disable registration of the box where regme will automatically take the _rem symlink and copy it to your main symlink, you will have issues since the socket it is still pointing to doesn't exist anymore.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.