Forge Home

sshkey_utilities

Utility functions for manipulating ssh keys

10,277 downloads

10,051 latest version

3.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.0.2 (latest)
  • 0.0.1
released Nov 9th 2013

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'bobtfish-sshkey_utilities', '0.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add bobtfish-sshkey_utilities
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install bobtfish-sshkey_utilities --version 0.0.2

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

bobtfish/sshkey_utilities — version 0.0.2 Nov 9th 2013

#sshkey_utilities

[Build Status

####Table of Contents

  1. Overview
  2. Reference - Functions included
  3. Limitations - OS compatibility, etc.
  4. Development - Guide for contributing to the module

##Overview

Provides funcions for manipulating ssh private and public keys from strings.

If you want to work on ssh keys in files then you can use the built in file() function to read them in, or my enhanced better_file module

##Reference

sshkey_fingerprint_from_public_key

Takes the public key text as a parameter and returns the key fingerprint.

For example:

$public_key = file('/etc/ssh/host_rsa_key.pub')
$fingerprint = sshkey_fingerprint_from_public_key($public_key)

sshkey_public_key_from_private_key

Generates and returns the public key corresponding to a given private key, the text of which should be supllied as a parameter.

The private key must not have a passphrase.

For example:

$private_key = file('/etc/ssh/host_rsa_key')
$public_key = sshkey_public_key_from_private_key($private_key)

##Limitations

This module should be compatible with any POSIX system which ships a 'setsid' command.

If your unix doesn't (coughApplecough) then see here: https://github.com/jerrykuch/ersatz-setsid

##Development

Patches welcome! Please send pull requests or suggestions on github.