diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2022-01-03 13:27:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2023-06-20 04:27:57 +0000 |
commit | 3d449be640dca3ae2b1124b7377c046c67fe36ab (patch) | |
tree | 10fdafb2da3ffd59a9b613d56b3cb2966e3862df /openssh/bin/ssh-ca | |
parent | openldap (WIP) (diff) | |
download | service-tools-3d449be640dca3ae2b1124b7377c046c67fe36ab.tar.xz service-tools-3d449be640dca3ae2b1124b7377c046c67fe36ab.zip |
openssh (WIP)
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rwxr-xr-x | openssh/bin/ssh-ca | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/openssh/bin/ssh-ca b/openssh/bin/ssh-ca new file mode 100755 index 0000000..675a2cf --- /dev/null +++ b/openssh/bin/ssh-ca @@ -0,0 +1,40 @@ +#!/bin/sh + +set -e + +HOST="$(cat /etc/hostname)" + +Init () +{ + echo "Init: creating CA key..." + + if [ -e "/etc/ssh-ca/keys/ssh-ca@${HOST}" ] || [ -e "/etc/ssh-ca/keys/ssh-ca@${HOST}.pub" ] + then + echo "/etc/ssh-ca/keys/ssh-ca@${HOST} key already exists" + exit 1 + fi + + mkdir -p /etc/ssh-ca/keys + ssh-keygen -f "/etc/ssh-ca/keys/ssh-ca@${HOST}" -t ed25519 -C ssh-ca@${HOST} -N "" +} + +Sign () +{ + FILE="${1}" + +} + +case "${1}" in + init) + Init + ;; + + sign) + Sign + ;; + + *) + echo "Usage: ${0} {init}" + exit 1 + ;; +esac |