From b18899ffaffad71a2b2f8783d97bcab876ab22a1 Mon Sep 17 00:00:00 2001 From: Simponic Date: Wed, 21 Dec 2022 14:05:10 -0700 Subject: [PATCH] Add make_keys script --- lib/chessh/auth/keys.ex | 4 +--- priv/make_keys.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100755 priv/make_keys.sh diff --git a/lib/chessh/auth/keys.ex b/lib/chessh/auth/keys.ex index a948fdf..e90f101 100644 --- a/lib/chessh/auth/keys.ex +++ b/lib/chessh/auth/keys.ex @@ -1,8 +1,6 @@ defmodule Chessh.Auth.KeyAuthenticator do - alias Chessh.Key - alias Chessh.Repo + alias Chessh.{Key, Repo} use Sshd.PublicKeyAuthenticator - require Logger import Ecto.Query def authenticate(username, public_key) do diff --git a/priv/make_keys.sh b/priv/make_keys.sh new file mode 100755 index 0000000..bd65aec --- /dev/null +++ b/priv/make_keys.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +mkdir keys +chmod 700 keys +cd keys + +ssh-keygen -N "" -b 256 -t ecdsa -f ssh_host_ecdsa_key +ssh-keygen -N "" -b 1024 -t dsa -f ssh_host_dsa_key +ssh-keygen -N "" -b 2048 -t rsa -f ssh_host_rsa_key \ No newline at end of file