Question

I am now successfully running a php script in a linux .us located server i own. I own another linux .de located server which doesnt have apache/php services. Can i use the 2nd box as an ssh tunnel or proxy or port bounce or something so i can hide my ip from the 1st box and how? I already have pbnc installed in the 2nd box but i don't know if this can achieve this? I already know how i can accomplish this with windows and putty but how is this possible by linux terminal. Sorry for my bad English and thanks a lot in advance!

Was it helpful?

Solution

If I understood, you want to execute one script that is on other server via ssh? Right? If this is a case you need to login to server number two without password. This is easy.

First way: All you have to do is generate ssh keys (without password). Here is how you can do this. Second way (better): I am guessing that you do not have permissions to execute script on server number two. This is easily solved if you have access to second server. This is how you do it:

  • Enter visudo
  • Add this line at the end of file

apache ALL=(user) NOPASSWD: script_path

example

 apache ALL=(clamav) NOPASSWD: /usr/bin/clamscan

In the brackets you enter user that have permission to execute your script. srcipt_path is in above example /usr/bin/clamscan.

  • With curl from server one you open some file on server two (lts call it script.php)
  • Edit script.php and add

$do = exec("some_script some_arguments")

and that is it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top