Step by step:
=============

THIS DOCUMENT IS UTTERLY OUT OF DATE.
We are only keeping it as it contains some items worth remembering.
Take none of it literally.


Set up authority:
-----------------
    1- Create database.
       certlocal newdbase 

    2- Create client authority with defaults to use for administrators.
       certlocal  newclientca -a pbz@ogopogo.biz -u gituser relay tunneladmin ubuntu -c {FQDN} -t bzadmin
       
    3- Create client authority with defaults to use for users.
       certloacl newclientca -a pbz@ogopogo.biz -u gituser relay  -c {FQDN} -t bzuser

    4- Create host authority.
       ssh-cert newhostca -a pbz@ogopogo.biz -f {FQDN} -v 52 -t bzhosts

Configure Server Host for host and client certificattion
--------------------------------------------------------
    1- Initialize each server
       certserver certifyservers
       OR
       certserver certifyservers -f guanabana.bernatchez.net mamey.ogopogo.biz -a pbz@ogopogo.biz -t bzhosts -o relay repo -v 52

    2- Whenever you add a new CA or revoke a user certificate
       certserver refreshservers
       OR for just some of the servers
       certserver refreshservers -f guanabana.bernatchez.net mamey.ogopogo.biz

    3- Whenever you respawn a server AMI or a server certificate expires.
       certserver recertifyservers
       OR for just one of the servers
       certserver recertifyservers -f guanabana.bernatchez.net

Configure Clients for host and client certificate authentication
----------------------------------------------------------------
CA:
    1- certlocal ssh_config >ssh_config.globalknownhostsfile
    2- certlocal known_hosts >ssh_known_hosts.authority
    3- publish the above two files where client users can download them

    4- receive .pub key files from clients and return -cert.pub files to the client.

CLIENT:
    Note: suggested commands work on ubuntu. Other systems may differ.
    1- download ssh_config.globalknownhostsfile (review for consistency with client host system)
       download ssh_known_hosts.authority

    2- Optionally remove exisiting GlobalKnownHostsFile snippets from ssh_config
       grep -E -v '^GlobalKnownHostsFile|ssh_certificate generated snippet' /etc/ssh/ssh_config | sudo tee /etc/ssh/ssh_config
    
    3- Append globalknownhostsfile snippet to ssh_config file
       cat ssh_config.globalknownhostsfile | sudo tee -a /etc/ssh/ssh_config

    4- Append certificate authority snippet to the Global Known Hosts File
       cat ssh_known_hosts.authority | sudo /usr/bin/tee -a /etc/ssh/ssh_known_hosts


    5- generate key pair that will be used to access server(s)

       We need the key file names to be globally unique.  So the
       client should incorporate the name of the computer he will be
       connecting from in the key name.
       
       /usr/bin/ssh-keygen -b 4096 -t rsa -C clienthostname_purpose -f clienthostname_purpose

    6- attach the clienthostname_purpose.pub file to an email to the CA who will
       return the certificate clienthostname_purpose-cert.pub. Put the cert file
       in the same directory as the private key file.  When the private key
       is loaded by ssh-add, the certificate will also be loaded.





       
