3 # setup-openssh.pl - substitutes variables into text files and runs
6 # adapted from 'fixpath', located in the openssh-3.0.2p1 package
10 # Set up path prefixes for use in the path translations
13 $prefix = "/home/cphillip/gsi-openssh/install";
14 $exec_prefix = "$prefix";
15 $bindir = "$exec_prefix/bin";
16 $libexecdir = "$exec_prefix/libexec";
17 $sysconfdir = "$prefix/etc";
19 $xauth_path = "/usr/bin/X11/xauth";
24 # Set up path translations for the installation files
28 "/etc/ssh_config" => "${sysconfdir}/ssh_config",
29 "/etc/ssh_known_hosts" => "${sysconfdir}/ssh_known_hosts",
30 "/etc/sshd_config" => "${sysconfdir}/sshd_config",
31 "/usr/libexec" => "${libexecdir}",
32 "/etc/shosts.equiv" => "${sysconfdir}/shosts.equiv",
33 "/etc/ssh_host_key" => "${sysconfdir}/ssh_host_key",
34 "/etc/ssh_host_dsa_key" => "${sysconfdir}/ssh_host_dsa_key",
35 "/etc/ssh_host_rsa_key" => "${sysconfdir}/ssh_host_rsa_key",
36 "/var/run/sshd.pid" => "${piddir}/sshd.pid",
37 "/etc/moduli" => "${sysconfdir}/moduli",
38 "/etc/sshrc" => "${sysconfdir}/sshrc",
39 "/usr/X11R6/bin/xauth" => "${xauth_path}",
40 "/usr/bin:/bin:/usr/sbin:/sbin" => "/usr/bin:/bin:/usr/sbin:/sbin:${bindir}",
44 # Files on which to perform path translations
62 print "\nTranslating strings in config/man files..\n";
68 open(IN, "<$f") || die ("$0: input file $f missing!\n");
72 print "$g already exists, skipping.\n";
76 open(OUT, ">$g") || die ("$0: unable to open output file $g!\n");
98 print "\nGenerating ssh keys (if necessary)..\n";
99 if ( -e "${sysconfdir}/ssh_host_key" )
101 print "${sysconfdir}/ssh_host_key already exists, skipping.\n";
105 # if $sysconfdir/ssh_host_key doesn't exist..
106 system("$bindir/ssh-keygen -t rsa1 -f $sysconfdir/ssh_host_key -N \"\"");
109 if ( -e "${sysconfdir}/ssh_host_dsa_key" )
111 print "${sysconfdir}/ssh_host_dsa_key already exists, skipping.\n";
115 # if $sysconfdir/ssh_host_dsa_key doesn't exist..
116 system("$bindir/ssh-keygen -t dsa -f $sysconfdir/ssh_host_dsa_key -N \"\"");
119 if ( -e "${sysconfdir}/ssh_host_rsa_key" )
121 print "${sysconfdir}/ssh_host_rsa_key already exists, skipping.\n";
125 # if $sysconfdir/ssh_host_rsa_key doesn't exist..
126 system("$bindir/ssh-keygen -t rsa -f $sysconfdir/ssh_host_rsa_key -N \"\"");