aboutsummaryrefslogtreecommitdiffstats
path: root/packages/carp_settings.xml
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-03-13 19:57:07 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-03-13 19:57:07 +0000
commit95183ba0763426546b5eb44c0b0ebd656853614b (patch)
tree340822619ccfd4b8bba20796f9e9d6ab04810c34 /packages/carp_settings.xml
parent7f9a624108c9c01bbba9728d882c399cc3577074 (diff)
downloadpfsense-packages-95183ba0763426546b5eb44c0b0ebd656853614b.tar.gz
pfsense-packages-95183ba0763426546b5eb44c0b0ebd656853614b.tar.bz2
pfsense-packages-95183ba0763426546b5eb44c0b0ebd656853614b.zip
Post keys to a remote pfSense via HTTP POST.
Diffstat (limited to 'packages/carp_settings.xml')
-rw-r--r--packages/carp_settings.xml25
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/carp_settings.xml b/packages/carp_settings.xml
index fce0262d..48bc1922 100644
--- a/packages/carp_settings.xml
+++ b/packages/carp_settings.xml
@@ -109,6 +109,18 @@
<cols>50</cols>
<type>textarea</type>
</field>
+ <field>
+ <fielddescr>Install keys</fielddescr>
+ <fieldname>installkeys</fieldname>
+ <description>Check this option and enter a password below of the remote box if you would like to automatically install the keys on the remote machine.</description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Install keys password</fielddescr>
+ <fieldname>installkeyspassword</fieldname>
+ <description>Enter the password of the remote machine that you would like to copy the keys to.</description>
+ <type>password</type>
+ </field>
</fields>
<custom_php_command_before_form>
@@ -129,6 +141,19 @@
fwrite($fout, $_POST['authorizedkeys']);
fclose($fout);
}
+ if($_POST['installkeys'] != "") {
+ $httpport = "80";
+ $cmd = "/bin/mkdir /root/.ssh";
+ /* make sure /root/.ssh exists */
+ $vararrays = array("cmd" => "mkdir -p /root/.ssh");
+ http_post($synchronizetoip, $httpport, "/exec_raw.php", $vararrays);
+ /* populate /root/.ssh/known_hosts */
+ $vararrays = array("cmd" => "echo \"{$_POST['knownhosts']}\" > /root.ssh/known_hosts");
+ http_post($synchronizetoip, $httpport, "/exec_raw.php", $vararrays);
+ /* populate /root/.ssh/authorized_keys */
+ $vararrays = array("cmd" => "echo \"{$_POST['authorizedkeys']}\" > /root.ssh/authorized_keys");
+ http_post($synchronizetoip, $httpport, "/exec_raw.php", $vararrays);
+ }
</custom_php_install_command>
<custom_php_deinstall_command>
</custom_php_deinstall_command>