]> andersk Git - gssapi-openssh.git/blame - setup/setup-openssh-keys.pl
o Add setup-openssh-keys and its perl script to the list of packaged files
[gssapi-openssh.git] / setup / setup-openssh-keys.pl
CommitLineData
8e65cfb6 1#
2# setup-openssh-keys.pl:
7c25a6d7 3# Generates the host keys for the openssh install.
8e65cfb6 4#
5# Send comments/fixes/suggestions to:
6# Chase Phillips <cphillip@ncsa.uiuc.edu>
7#
8
9$gpath = $ENV{GLOBUS_LOCATION};
10if (!defined($gpath))
11{
12 die "GLOBUS_LOCATION needs to be set before running this script"
13}
14
15#
16# i'm including this because other perl scripts in the gpt setup directories
17# do so
18#
19
20@INC = (@INC, "$gpath/lib/perl");
21
22require Grid::GPT::Setup;
23
24my $globusdir = $gpath;
25my $setupdir = "$globusdir/setup/globus";
26my $myname = "setup-openssh-keys.pl";
27
28print "$myname: Configuring keys for package 'gsi_openssh'...\n";
29
30#
31# Set up path prefixes for use in the path translations
32#
33
34$prefix = ${globusdir};
35$exec_prefix = "${prefix}";
36$bindir = "${exec_prefix}/bin";
8e65cfb6 37$sysconfdir = "/etc";
38
39sub runkeygen
40{
41 print "Generating ssh keys (if necessary)...\n";
42 if ( -e "${sysconfdir}/ssh_host_key" )
43 {
44 print "${sysconfdir}/ssh_host_key already exists, skipping.\n";
45 }
46 else
47 {
48 # if $sysconfdir/ssh_host_key doesn't exist..
49 system("$bindir/ssh-keygen -t rsa1 -f $sysconfdir/ssh_host_key -N \"\"");
50 }
51
52 if ( -e "${sysconfdir}/ssh_host_dsa_key" )
53 {
54 print "${sysconfdir}/ssh_host_dsa_key already exists, skipping.\n";
55 }
56 else
57 {
58 # if $sysconfdir/ssh_host_dsa_key doesn't exist..
59 system("$bindir/ssh-keygen -t dsa -f $sysconfdir/ssh_host_dsa_key -N \"\"");
60 }
61
62 if ( -e "${sysconfdir}/ssh_host_rsa_key" )
63 {
64 print "${sysconfdir}/ssh_host_rsa_key already exists, skipping.\n";
65 }
66 else
67 {
68 # if $sysconfdir/ssh_host_rsa_key doesn't exist..
69 system("$bindir/ssh-keygen -t rsa -f $sysconfdir/ssh_host_rsa_key -N \"\"");
70 }
71
72 return 0;
73}
74
8e65cfb6 75runkeygen();
This page took 0.071976 seconds and 5 git commands to generate.