shellpki/README.md

44 lines
908 B
Markdown
Raw Normal View History

2017-05-21 05:36:47 +02:00
# shellpki
2018-01-17 12:21:39 +01:00
This script is a wrapper around openssl to manage a small PKI.
2017-05-21 05:36:47 +02:00
2018-01-17 12:21:39 +01:00
## Install
2017-05-21 05:36:47 +02:00
2018-01-17 12:21:39 +01:00
~~~
mkdir /etc/shellpki
useradd shellpki --system -M --home-dir /etc/shellpki --shell /usr/sbin/nologin
install -m 0640 openssl.cnf /etc/shellpki/
install -m 0755 shellpki.sh /usr/local/sbin/shellpki
~~~
2017-05-21 05:36:47 +02:00
2018-01-17 12:21:39 +01:00
## Usage
2017-05-21 05:36:47 +02:00
2018-01-17 12:21:39 +01:00
~~~
2018-01-23 16:52:42 +01:00
Usage: ./shellpki.sh <subcommand> [options] [CommonName]
2017-05-21 05:36:47 +02:00
2018-01-23 16:52:42 +01:00
Initialize PKI (create CA key and self-signed cert) :
2017-05-21 05:36:47 +02:00
2018-01-23 16:52:42 +01:00
./shellpki.sh init
2017-05-21 05:36:47 +02:00
2018-01-23 16:52:42 +01:00
Create a client cert with key and CSR directly generated on server
(use -p for set a password on client key) :
2018-01-17 12:21:39 +01:00
2018-01-23 16:52:42 +01:00
./shellpki.sh create [-p] <commonName>
2018-01-17 12:21:39 +01:00
2018-01-23 16:52:42 +01:00
Create a client cert from a CSR (doesn't need key) :
2018-01-17 12:21:39 +01:00
2018-01-23 16:52:42 +01:00
./shellpki.sh create -f <path>
Revoke a client cert with is commonName (CN) :
./shellpki.sh revoke <commonName>
List all actually valid commonName (CN) :
./shellpki.sh list
2018-01-17 12:21:39 +01:00
~~~
2018-01-17 12:32:21 +01:00
## License
Shellpki are in GPLv2+, see [LICENSE](LICENSE).