For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
| # Add the following 'help' target to your Makefile | |
| # And add help text after each target name starting with '\#\#' | |
| help: ## Show this help. | |
| @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
| # Everything below is an example | |
| target00: ## This message will show up when typing 'make help' | |
| @echo does nothing |
| Key-Type: 1 | |
| Key-Length: 2048 | |
| Subkey-Type: 1 | |
| Subkey-Length: 2048 | |
| Name-Real: Root Superuser | |
| Name-Email: root@handbook.westarete.com | |
| Expire-Date: 0 |
| #!/bin/bash | |
| USAGE="Attach to Docker Container | |
| -------------------------- | |
| Attach to Docker Container even if the container does not run | |
| ssh daemon. This is accomplished by using linux containers | |
| directly via 'nsenter' (see http://bit.ly/docker_nsenter). | |
| To install 'nsenter', just execute: | |
| $ docker run -v /usr/local/bin:/target jpetazzo/nsenter |
| package tar_helper | |
| import ( | |
| "archive/tar" | |
| "compress/gzip" | |
| "errors" | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "os" |
| // A small SSH daemon providing bash sessions | |
| // | |
| // Server: | |
| // cd my/new/dir/ | |
| // #generate server keypair | |
| // ssh-keygen -t rsa | |
| // go get -v . | |
| // go run sshd.go | |
| // | |
| // Client: |
| # Set variables in .bashrc file | |
| # don't forget to change your path correctly! | |
| export GOPATH=$HOME/golang | |
| export GOROOT=/usr/local/opt/go/libexec | |
| export PATH=$PATH:$GOPATH/bin | |
| export PATH=$PATH:$GOROOT/bin |
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)| package main | |
| import ( | |
| "archive/tar" | |
| "compress/gzip" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "os" | |
| ) |