I'm using PHP to write shortcuts for common server admin tasks (I'm using deployer.org but this shouldn't be important). I want to add a task for starting an interactive bash prompt after SSHing into a server. For example, you would run "./dep ssh" (where "dep" is a PHP script) and this would have the same effect as running e.g. "ssh user@server" from the terminal. Is there a way to do this in PHP? For context, I have about 5 servers that I frequently want to SSH into, or read logs, or copy files etc. so I want shortcuts for this.
The closest I've been able to get is something like this:
$ph = popen("bash","w");
while(($line = fgets(STDIN)) !== false){
fputs($ph,$line);
}
pclose($ph);
This lets you send commands to and from bash but you don't see the normal bash prompt or get tab completion. I need something like this but with all the normal bash features working.
If you are simply looking to do SSH in web-browser this is what you are may be looking for one of the following products:
Here is a link that you might like taking a look at.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With