From 099f505f9526311e48f828e95d90d488fe237219 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 22 Jun 2000 20:57:11 +1000 Subject: - (djm) Automatically generate host key during "make install". Suggested by Gary E. Miller - (djm) Paranoia before kill() system call --- Makefile.in | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index b18444d3d..f5af10d7e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -112,7 +112,9 @@ catman-do: >$${f%%.[18]}.0 ; \ done -install: manpages $(TARGETS) +install: manpages $(TARGETS) install-files host-key + +install-files: ./mkinstalldirs $(DESTDIR)$(bindir) ./mkinstalldirs $(DESTDIR)$(sbindir) ./mkinstalldirs $(DESTDIR)$(mandir) @@ -134,7 +136,6 @@ install: manpages $(TARGETS) ln -s ssh $(DESTDIR)$(bindir)/slogin -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 ln -s ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 - if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config -a ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \ ./mkinstalldirs $(DESTDIR)$(sysconfdir); \ $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \ @@ -146,6 +147,18 @@ install: manpages $(TARGETS) fi host-key: ssh-keygen + if [ -f "$(sysconfdir)/ssh_host_key" ] ; then \ + echo "$(sysconfdir)/ssh_host_key already exists, skipping." ; \ + else \ + ./ssh-keygen -b 1024 -f $(sysconfdir)/ssh_host_key -N "" ; \ + fi ; \ + if [ -f $(sysconfdir)/ssh_host_dsa_key ] ; then \ + echo "$(sysconfdir)/ssh_host_dsa_key already exists, skipping." ; \ + else \ + ./ssh-keygen -d -f $(sysconfdir)/ssh_host_dsa_key -N "" ; \ + fi ; + +host-key-force: ssh-keygen ./ssh-keygen -b 1024 -f $(sysconfdir)/ssh_host_key -N "" ./ssh-keygen -d -f $(sysconfdir)/ssh_host_dsa_key -N "" -- cgit v1.2.3