summaryrefslogtreecommitdiffstats
path: root/openssh/bin/ssh-ca
diff options
context:
space:
mode:
Diffstat (limited to 'openssh/bin/ssh-ca')
-rwxr-xr-xopenssh/bin/ssh-ca40
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