From 3a529129641b6fa7e4c0db720e7b5964989bfa43 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 3 Jan 2022 14:27:43 +0100 Subject: Adding openssh-tools (WIP). Signed-off-by: Daniel Baumann --- openssh/bin/ssh-ca | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 openssh/bin/ssh-ca (limited to 'openssh/bin/ssh-ca') 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 -- cgit v1.2.3