From 2e4f5a9b65394b411bdd02c34067265efec95e41 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Mon, 30 Nov 2015 11:49:30 +0200
Subject: [PATCH] More work on testing.

---
 .gitignore  | 1 +
 Makefile    | 4 +++-
 ssh_config  | 6 ++++++
 sshd_config | 2 +-
 4 files changed, 11 insertions(+), 2 deletions(-)
 create mode 100644 ssh_config

diff --git a/.gitignore b/.gitignore
index 15e5be1..1605632 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@ CA*
 users/
 hosts/
 .server.pid
+known_hosts
diff --git a/Makefile b/Makefile
index ef07667..f9d4d6a 100644
--- a/Makefile
+++ b/Makefile
@@ -5,10 +5,12 @@ install:
 	chmod 755 /usr/local/bin/ssh-ca
 
 clean:
-	rm -rf CA CA.pub users hosts
+	rm -rf CA CA.pub users hosts known_hosts
 
 test: clean
 	./ssh-ca init
 	./ssh-ca newuser $$USER
 	./ssh-ca newhost localhost
+	echo "@cert-authority * $$(cat CA.pub)" > known_hosts
 	$$(which sshd) -dddf sshd_config
+	#ssh -F ssh_config test
diff --git a/ssh_config b/ssh_config
new file mode 100644
index 0000000..a841a3b
--- /dev/null
+++ b/ssh_config
@@ -0,0 +1,6 @@
+Host test
+HostName localhost
+Port 22222
+IdentityFile users/%u
+UserKnownHostsFile known_hosts
+StrictHostKeyChecking yes
diff --git a/sshd_config b/sshd_config
index 9784d31..b9d5198 100644
--- a/sshd_config
+++ b/sshd_config
@@ -1,7 +1,7 @@
 ListenAddress 127.0.0.1:22222
 HostKey hosts/localhost
 TrustedUserCAKeys ssh_ca.pub
-HostCertificate hosts/localhost.pub
+HostCertificate hosts/localhost-cert.pub
 Banner "ssh-ca dummy test daemon"
 PasswordAuthentication no
 PermitRootLogin no
-- 
GitLab