From 14b56d92878ec6cb624f708044f6bec04d874066 Mon Sep 17 00:00:00 2001 From: "Andreas Burchert (scarya)" Date: Sun, 17 Oct 2010 00:29:04 +0000 Subject: [PATCH] - fixed eol-style from FroxlorSshTransport - added a demo usage script for FroxlorSshTransport --- lib/classes/sshtransport/demousage.php | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 lib/classes/sshtransport/demousage.php diff --git a/lib/classes/sshtransport/demousage.php b/lib/classes/sshtransport/demousage.php new file mode 100644 index 00000000..db8b06de --- /dev/null +++ b/lib/classes/sshtransport/demousage.php @@ -0,0 +1,46 @@ +sendCmd("ls -alF"); + +/* + * The return result is an array with lines read from stdin + */ +$outputArray = $transport->readAll(); + +/* + * Let's copy our sshd_config to the remote host. + */ +$transport->sendFile("/etc/ssh/sshd_config", "/etc/ssh/sshd_config", 0644); + +/* + * Close this session. + */ +$transport->close(); + +/* + * Create a new ssh session with pubkey authentication. + */ +$transport = FroxlorSshTransport::usePublicKey("test.froxlor.org", 22, "testUserSSh", "/path/to/pubkey.key", "/path/to/private.key", "myPassphrase1337"); + +/* + * Clean up and finish. + */ +$transport->close(); +?> \ No newline at end of file