summaryrefslogtreecommitdiff
path: root/keys.mdwn
blob: 6d4af2f3894b70ec15610c9dbe7cfbfdd5015d9c (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
Reposit�rio de chaves
=====================

    # Configuracao
    project="exemplo"
    domain="examplo.org"
    admin="nodo_admin"
    admin_port="porta_ssh"
    base="$HOME/coletivos/$project/conf/puppet"
    
    # Inicializando
    keyringer $project init $HOME/coletivos/$project/conf/keyring
    
    # Gerando chaves para https
    keyringer $project genpair ssl cert $project.info
    
    # Gerando chaves ssh e gpg para novos nodos
    # A importacao das chaves gpg nos nodos deve ser feita manualmente
    for class in `ls $base/manifests/nodes`; do
      node="`basename $class .pp`"
      privkey="$base/files/keys/"$node"_id_dsa"
      pubkey="$privkey.pub"
      if [ ! -e "$privkey" ] || [ ! -e "$pubkey" ]; then
        keyringer $project genpair ssh $node/ssh/id_dsa $node.$domain $privkey
        keyringer $project genpair gpg $node/gpg/key    $node.$domain
      fi
    done
    
    # Submetendo
    keyringer $project git remote add origin ssh://gitosis@$admin.$domain:$admin_port/keyring.git
    keyringer $project git push origin master

Importa��o de chaves GPG
------------------------

Importando chaves nos seus respectivos nodos:

    gpg --import        # colar a chave privada
    gpg --edit-key <id> # ajustar confiabilidade dessa chave para 5 com o comando "trust"
    gpg --list-keys     # atualizar o trust db