make install

Ben Lindstrom mouring at pconline.com
Thu Jun 22 10:05:17 EST 2000


Would something like this be more to your like?

It will check to see if the DSA and RSA key exists.. If not it creates
them.  If they are it puts out a nice message saying you can use
'make host-key-rsa'  or 'make host-key-dsa'  to recreate them.

Ben Lindstrom

On Wed, 21 Jun 2000, Gary E. Miller wrote:

> Yo Paul!
> 
> I just installed 2.1.1p1 on a clean host and I do not see these
> in the Makefile.  I do see a "make host-key" that I missed before but it
> is not called by default from "make install" and does not check before
> clobbering any existing keys.
> 
> I see the lines that you are talking about in the redhat and suse
> stuff but I do not use those.  Having it in the makefile would be 
> preferred.
> 
> RGDS
> GARY
> 
> On Wed, 21 Jun 2000, Paul Heinlein wrote:
> 
> > On Wed, 21 Jun 2000, Paul Heinlein wrote:
> > 
> > > Along those lines, I think it's worth noting that Damien's
> > > contrib/redhat/openssh.spec file does a very nice job with that:
> > > 
> > > %files clients
> > > ...
> > 
> > Oops. I was thinking in a parallel universe and included Damien's
> > stuff with the config files. His spec file does the right thing with
> > host keys, too:
> > 
> > if [ ! -f /etc/ssh/ssh_host_key -o ! -s /etc/ssh/ssh_host_key ]
> > then
> >         /usr/bin/ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N '' >&2
> > fi
> > if [ ! -f /etc/ssh/ssh_host_dsa_key -o ! -s /etc/ssh/ssh_host_dsa_key]
> > then
> >         /usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N '' >&2
> > fi
> > 
> > Sorry for the mailbloat.
> > 
> > Paul Heinlein
> > heinlein at cse.ogi.edu
> > 
> > 
> > 
> 
> ---------------------------------------------------------------------------
> Gary E. Miller Rellim 20340 Empire Ave, Suite E-3, Bend, OR 97701
> 	gem at rellim.com  Tel:+1(541)382-8588 Fax: +1(541)382-8676
> 
> 
-------------- next part --------------
--- Makefile.in.orig	Wed Jun 21 12:54:46 2000
+++ Makefile.in	Wed Jun 21 13:15:03 2000
@@ -144,10 +144,24 @@
 		$(PERL) fixprogs ssh_prng_cmds $(ENT); \
 		$(INSTALL) -m 644 ssh_prng_cmds.out $(DESTDIR)$(sysconfdir)/ssh_prng_cmds; \
 	fi
+	if [ ! -f $(sysconfdir)/ssh_host_key ]; then \
+		./ssh-keygen -b 1024 -f $(sysconfdir)/ssh_host_key -N ""; \
+	else \
+		echo "To recreate RSA key use 'make host-key-rsa'"; \
+	fi
+	if [ ! -f $(sysconfdir)/ssh_host_dsa_key ]; then \
+		./ssh-keygen -d -f $(sysconfdir)/ssh_host_dsa_key -N ""; \
+	else \
+		echo "To regnerate DSA key use 'make host-key-dsa'"; \
+	fi
 
-host-key: ssh-keygen
+host-key-rsa:ssh-keygen
 	./ssh-keygen -b 1024 -f $(sysconfdir)/ssh_host_key -N ""
+
+host-key-dsa:ssh-keygen
 	./ssh-keygen -d -f $(sysconfdir)/ssh_host_dsa_key -N ""
+
+host-key: host-key-rsa host-key-dsa
 
 uninstallall:	uninstall
 	-rm -f $(DESTDIR)$(sysconfdir)/ssh_config


More information about the openssh-unix-dev mailing list