2 # setup-openssh-keys.pl:
3 # Generates the host keys for the openssh install.
5 # Send comments/fixes/suggestions to:
6 # Chase Phillips <cphillip@ncsa.uiuc.edu>
9 $gpath = $ENV{GLOBUS_LOCATION};
12 die "GLOBUS_LOCATION needs to be set before running this script"
16 # i'm including this because other perl scripts in the gpt setup directories
20 @INC = (@INC, "$gpath/lib/perl");
22 require Grid::GPT::Setup;
24 my $globusdir = $gpath;
25 my $setupdir = "$globusdir/setup/globus";
26 my $myname = "setup-openssh-keys.pl";
28 print "$myname: Configuring keys for package 'gsi_openssh'...\n";
31 # Set up path prefixes for use in the path translations
34 $prefix = ${globusdir};
35 $exec_prefix = "${prefix}";
36 $bindir = "${exec_prefix}/bin";
41 print "Generating ssh keys (if necessary)...\n";
42 if ( -e "${sysconfdir}/ssh_host_key" )
44 print "${sysconfdir}/ssh_host_key already exists, skipping.\n";
48 # if $sysconfdir/ssh_host_key doesn't exist..
49 system("$bindir/ssh-keygen -t rsa1 -f $sysconfdir/ssh_host_key -N \"\"");
52 if ( -e "${sysconfdir}/ssh_host_dsa_key" )
54 print "${sysconfdir}/ssh_host_dsa_key already exists, skipping.\n";
58 # if $sysconfdir/ssh_host_dsa_key doesn't exist..
59 system("$bindir/ssh-keygen -t dsa -f $sysconfdir/ssh_host_dsa_key -N \"\"");
62 if ( -e "${sysconfdir}/ssh_host_rsa_key" )
64 print "${sysconfdir}/ssh_host_rsa_key already exists, skipping.\n";
68 # if $sysconfdir/ssh_host_rsa_key doesn't exist..
69 system("$bindir/ssh-keygen -t rsa -f $sysconfdir/ssh_host_rsa_key -N \"\"");