Answer the question
In order to leave comments, you need to log in
How to make ssh client in php?
Hello. I'm trying to send a command to ssh like this -
$connection = ssh2_connect($host, $port);
ssh2_auth_password($connection, $login, $password);
$stream = ssh2_exec($connection, $cmd);
echo $stream;
But there is a problem, in commands like "apt-get upgrade" you need to accept "y" to continue the installation, so the scripts have their own commands that I need to send via ssh. How to accept "y" or execute a command in a script via ssh2. Maybe I didn't explain well...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question