From 95183ba0763426546b5eb44c0b0ebd656853614b Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 13 Mar 2005 19:57:07 +0000 Subject: Post keys to a remote pfSense via HTTP POST. --- packages/carp_settings.xml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'packages') 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 @@ 50 textarea + + Install keys + installkeys + 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. + checkbox + + + Install keys password + installkeyspassword + Enter the password of the remote machine that you would like to copy the keys to. + password + @@ -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); + } -- cgit v1.2.3