jpr105
Occasional Visitor
Hello,
I need to access my RT-AC68U in SSH. So I configured the router as follows:
And I can see my connection on the router's log:
This is fine but I especially want to do it in PHP with LibSSH2.
So I wrote this code and it does not work.
RT-AC68U Log
Can someone help me please?
Thank you in advance
Regards - Jean-Paul
I need to access my RT-AC68U in SSH. So I configured the router as follows:
- Enable SSH = LAN Only
- Allow SSH Port Forwarding = Yes (not sure this is necessary)
- SSH port = 2222
- Allow Password Login = Yes
- Enable SSH Brute Force Protection = Yes
Code:
ssh Master@192.168.xxx.xxx -p 2222
And I can see my connection on the router's log:
dropbear: Password auth succeeded for 'Master' from 192.168.10.80
This is fine but I especially want to do it in PHP with LibSSH2.
So I wrote this code and it does not work.
PHP:
$ASUS_IP = "IP routeur";
$ASUS_Port = "Port routeur";
$ASUS_User = "User";
$ASUS_Psw = "Password";
$AsusSSH = ssh2_connect ($ASUS_IP, intval($ASUS_Port));
$AsusLogin = ssh2_auth_password ($AsusSSH , $ASUS_User, $ASUS_Psw);
/* Vérification de la connexion */
if ($AsusLogin) {
echo 'Connexion SSH effectué<br />';
} else {
echo 'Connexion SSH échouée<br />';
}
RT-AC68U Log
PHP Logdropbear: Login attempt for nonexistent user from 192.168.10.80
PHP Warning: ssh2_auth_password (): Authentication failed for Master using password
Can someone help me please?
Thank you in advance
Regards - Jean-Paul