log into remote server and run a local shellscript


I am experiencing a brain fart and all I can see is no longer making sense to me. I would like to ask for some of your expertise and help me clear the fog off my eyes.

I need to log into a remote server, which I am able to do by using the following code:

$connect = ssh2_connect(‘ipaddress’, 22);
$auth = ssh2_auth_password($connect, ‘username’, ‘password’);

But how can I make the server run a shellscript that is hosted in the php server?

I will really appreciate some guidance in this matter



You don’t need to log in if the script is already on that server, but you would use passthru(), system() or exec().

Sorry… I guess I did not make myself clear…

I log into remote server, in which I want to run a shellscript hosted in my localserver…

I have tried a few things… but have not tried passthrough() will read about it, if it works, I will certainly post results…



Sponsor our Newsletter | Privacy Policy | Terms of Service