you can achieve this via php :)
1) Install SSH for PHP - sudo apt-get install libssh2-1-dev libssh2-php
2)Check that is installed: php -m |grep ssh2
3: Restart apache: sudo service apache2 restart
Now for the PHP part
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$stream = ssh2_exec($connection, '/usr/local/bin/php -i');
No comments:
Post a Comment