Jump to content

cristalmolix

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cristalmolix's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. using ssh i got the full error it said server dosent allow shell connections
  2. hello guys im having to create a multidimensional array in php 4 and it seems to not build the same way as in php 5 , is there any noted differences i should know about ? im using the loop arr[][item] = bla arr[][item2] = blah i had to use the id in the [id] it adds them as seperate entities will i have issues appending arrays to arrays thanks
  3. shell acccess disables on server, full error wioth ssh command
  4. thanks fen, i ended up doing it in arrays, the sql is too much
  5. thanks very much but i have a windows setup of cyghwin openssh my distro contains ssh-keygen -t rsa but does not have ssh-copy-id any ideas ?
  6. Can someone briefly outline the process of storing an SSH key on your local machine so you dont have to type a password
  7. after i enter teh password HOWEVER ITS DONE, lets say SSH KEYS are not setup, if for instance i get an error saying "this server dosent allow shell connections" how do i get that to the screen, the above script seems to output DIR etc etc to teh browser screen but wont output the result of teh ssh command whats the difference ?
  8. do i have to setup the keys or can i somehow feed the password into the prompt from the php script or the batch file ? im using proc_open so i can feed stuff in to the pipe <?php public function indexAction() { echo "1"; $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("file", "C:\\error-output.txt", "a") // stderr is a file to write to ); echo "2"; $cwd = 'C:\\'; $env = array('some_option' => 'aeiou'); echo "3"; $process = proc_open('start c:\\test.bat', $descriptorspec, $pipes); sleep(10); echo "4"; if (is_resource($process)) { // $pipes now looks like this: // 0 => writeable handle connected to child stdin // 1 => readable handle connected to child stdout // Any error output will be appended to /tmp/error-output.txt echo "5"; fwrite($pipes[0], '<?php print_r($_ENV); ?>'); fflush($pipes[0]); fclose($pipes[0]); echo "6"; echo stream_get_contents($pipes[1]); fclose($pipes[1]); echo "7"; // It is important that you close any pipes before calling // proc_close in order to avoid a deadlock $return_value = proc_close($process); echo "8"; echo "command returned $return_value\n"; echo "9"; } echo "10"; exit; } ?>
  9. hello guys i have a .bat file it goes liek this ssh nadeemsh@nadeemshafi.co.uk test.dat exit; teh ssh without public key asks for a password i dont want to do this manualy so how do i get it to enter the password, the command ssh doesent take teh password in i know i can read files in dos or wotever but how do i know when to enter it and tell it to enter it when ssh asks for it ?? thanks
  10. Hello Guys I have a script in development to execute a .bat file on windows, the bat file calls ssh blah@blah.com test.dat which creates a file on the server, however shell access is not allowed on the server and the command line will output please contact admin to get shell access, i need to output this to the browser, my code so far is as follows. I understand how pipes work but need some guidance from someone whos done this before or similar. currently the browser outputs process returned 0 when i close the command line that it opens, i need the command line to close itself obviously and take any output from it. and also i need to give it the password, i know this is done through the pip but its kinda tricky. C:\test.bat ssh blah@blah.co.uk test.dat zend framework controller public function indexAction() { $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("file", "/error-output.txt", "a") // stderr is a file to write to ); $cwd = '/tmp'; $env = array('some_option' => 'aeiou'); $process = proc_open('start c:\test.bat', $descriptorspec, $pipes); //sleep(1); if (is_resource($process)) { // $pipes now looks like this: // 0 => writeable handle connected to child stdin // 1 => readable handle connected to child stdout // Any error output will be appended to /tmp/error-output.txt fwrite($pipes[0], '<?php print_r($_ENV); ?>'); fclose($pipes[0]); echo stream_get_contents($pipes[1]); fclose($pipes[1]); // It is important that you close any pipes before calling // proc_close in order to avoid a deadlock $return_value = proc_close($process); echo "command returned $return_value\n"; } exit; } thanks for any help
  11. hi guys im using rsync to sync from my windows machine to a linux box ok so my command is rsync -avz --delete "/cwRsync" username@subdomain.strongspace.com:testrsync ok obviously i replace it with my stuff the prob is it asks me for my password and then just hangs if i bash the keyboard it says connection closed by the servers ip i have openssh installed cygwin and rsync under windows and cygwin packaged any help ?
  12. hi guys im joing 2 tables onto a users and then joining another table onto them tables and then i want all the users and then a count of all there observations and a count of all the uploaded images for that observation. SELECT u.username AS Username, u.id AS 'User ID', u.title AS 'Title', u.forename AS 'First Name', u.surname AS 'Last Name', u.address1 AS 'Address Line 1', u.address2 AS 'Address Line 2', u.town AS 'Town/City', c.title AS 'County', u.postcode AS 'Postcode', u.age AS 'Age', u.youth_name AS 'School Name', count(i.observation_id) AS 'Number Of Uploads', count(o.id) AS 'Number Of Identifications', CASE WHEN u.ispot = 1 THEN 'No' ELSE 'Yes' END AS 'Mailing List Subscribed (Yes\No)', u.email AS 'Email Address' FROM user u LEFT JOIN (observation o, county c, image i) ON (u.id = o.user_id AND u.county_id = c.id AND i.observation_id = o.id) WHERE 1=1 {$from_to_filter} {$subscribed_filter} GROUP BY o.user_id its just not working out in order to count i have to use group by and that makes the 1300 users turn into 230 for some reason ??????????? any help suggestions would be very much appreciated thanks
  13. if your going to exit you have to include the class somhow
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.