开发者

How to execute an SSH Command in a BASH Shell Script by way of a PHP program?

开发者 https://www.devze.com 2023-01-28 13:12 出处:网络
I am interested in having someone or as many technicians as possible to assist me, or provide me with an understanding of how PHP processes an SSH command

I am interested in having someone or as many technicians as possible to assist me,

or provide me with an understanding of how PHP processes an SSH command

ssh username@hostname "ssh-script",

for remote access, embedded in a Bash Shell Script.

Initially I made many attempts to use PHP's ssh2_command()

function to no avail due mostly to the function not being recognized by the PHP interpreter.

My thinking is that perhaps SSH2 is not configured properly on my MAC OS X server.

I based my configuration on what I researched via the internet

  • http://hi开发者_如何学Gonts.macworld.com/article.php?story=20010527220633471,
  • http://www.3thirty.net/blog/?p=52

which appeared to install properly. Unfortunately, even with the good instruction, SSH2 does not work for me.

Any assistance will be appreciated.


You could try phpseclib, a pure PHP SSH implementation

0

精彩评论

暂无评论...
验证码 换一张
取 消