aboutsummaryrefslogtreecommitdiffstats
path: root/external/sshkeys/README.rst
blob: f770e4bf889bf7e684e07b5e8b221c0a2dcd177e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
sshkeys puppet module
=====================

The sshkeys puppet module allow the creation and installation of ssh keys.


How it works
============

With the sshkeys module, you define a key that will be generated on the
puppet master. You define where this key should be installed, for the
client key pair, and for the authorized_keys.

When the key has not been generated yet, you may need to run puppet
twice. The key will be generated on the first run, and installed on the
second run.


Usage
=====

In order to tell which node will generate the keys, you need to include
the `sshkeys::keymaster` class on the puppet master node::

  include sshkeys::keymaster

Before installing the key, we need to create it. This is done with the
`create_key` ressource, on the puppet master node. We can create the key
`key1`::

  sshkeys::create_key{key1: }

If we want to install the `key1` key pair for user `user1`, we can use
the `set_client_key_pair` ressource::

  sshkeys::set_client_key_pair{'key1-for-user1':
    keyname => 'key1',
    home => '/home/user1',
    user => 'user1',
  }

The `key1` private and public keys should now be installed for user
`user1` on the node on which we created this ressource.

If we want to allow the key `key1` to connect to the `user2` account,
we use the `set_authorized_keys` ressource::

  sshkeys::set_authorized_keys{'key1-to-user2':
    keyname => 'key1',
    user => 'user2',
    home => '/home/user2',
  }

Now, `user1` should have the `key1` key pair installed on his account,
and be able to login to the `user2` account.


License
=======

This module is released under the GNU General Public License version 3:
http://www.gnu.org/licenses/gpl-3.0.txt


Authors
=======

The sshkeys module is based on the ssh::auth module written by
Andrew E. Schulman <andrex at alumni dot utexas dot net>.

The original ssh::auth module is available at this URL :
http://projects.puppetlabs.com/projects/1/wiki/Module_Ssh_Auth_Patterns