whitepaper Posted March 25, 2012 Share Posted March 25, 2012 Here is my code: <?php $con = ssh2_connect('crm.idea.com.bd','4321'); ssh2_auth_password($con, 'username', 'password'); $response = ssh2_exec($con, 'pwd'); echo $response; ?> I can connect to that server using that username, password and port address. But when I load this script it don't work. It shows loading and loading continues. No error message is given. N: B: Please help me. I am a newbie. Quote Link to comment https://forums.phpfreaks.com/topic/259677-connection-problem-to-remote-server-via-ssh2_connect/ Share on other sites More sharing options...
mitramcc Posted March 25, 2012 Share Posted March 25, 2012 Add some echos to debug that... if(!($con = ssh2_connect("server1.example.com", 22))){ echo "fail: unable to establish connection\n"; } else { // try to authenticate with username root, password secretpassword if(!ssh2_auth_password($con, "root", "secretpassword")) { echo "fail: unable to authenticate\n"; }else{ echo "you are in"; (...) } } and you can also check this link http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ Quote Link to comment https://forums.phpfreaks.com/topic/259677-connection-problem-to-remote-server-via-ssh2_connect/#findComment-1330920 Share on other sites More sharing options...
whitepaper Posted March 27, 2012 Author Share Posted March 27, 2012 :'( :'( Nothing changed. Same loading problem. Quote Link to comment https://forums.phpfreaks.com/topic/259677-connection-problem-to-remote-server-via-ssh2_connect/#findComment-1331469 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.