且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 PHP SSH 连接到远程服务器

更新时间:2023-01-20 07:42:06

phpseclib

  • 此处这里(直接链接),

    phpseclib

    • Download it from here or here ( direct link ) ,

      将其添加到项目中,

      然后:

         include('Net/SSH2.php');
         $ssh = new Net_SSH2('www.example.com');
         $ssh->login('username', 'password') or die("Login failed");
         echo $ssh->exec('command');