Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Problem ssh login from PHP webapp using expect script

General discussions related to php

Moderators: macek, egami, gesf

Problem ssh login from PHP webapp using expect script

Postby msandeep12 » Mon Jan 28, 2013 5:02 am

I m using a Php program ,which on click triggers a shell script ,with in which it try to ssh to remote host and login.. to pass the password for ssh to remote host ,i m using expect script(whihc supplies the password)
when i run this script through shell command line it works perfectly.but when i use the php web program it is not working .the expect script triggers ssh to remote host but password is not supplied .

expect script which is triggered by shell script

spawn ssh -t IPAddress
expect "*?assword:*"
send "password\r"

PHP script

passthru('/<pathto script>/wrapper.exp>wrapper.log');


the above php is triggered by html for on click

Thanks in advance
Sandeep M
New php-forum User
New php-forum User
Posts: 1
Joined: Mon Jan 28, 2013 4:51 am

Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.