-
-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how can i test login password #1144
Comments
I'm not sure I understand your question. I mean, it looks like you're trying the same password 3x times. If it didn't work once I wouldn't expect it to work again? I mean, I suppose you could be using multi factor authentication with that just happens to want the same password twice, but idk - that seems like that'd be a bit weird. I do wonder why you're using the error suppression operator... That said, if you want to test a certain password after you've already logged in... on Linux you could do |
@terrafrost thx for your answer, before i login the system idk the right password is which one .so i i must try three different password 。and H3C router could be login by using password authentication .but i found the cisco device is difference .some cisco router must use keyboard-interactive authentication . so i wirte two function and i want to know.if i‘m trying the wrong password login ,and $ssh->login("$first username","$first passowrd") return false . how can i try the second password. i use the error suppression operator,because some login method is ok on a cisco device,but it's report a user notice errer on another cisco device。i must make sure the script won't break by these notice |
You could just try this: if ($ssh->login('username', 'password1')) {
return true;
}
if ($ssh->login('username', 'password2')) {
return true;
}
if ($ssh->login('username', 'password3')) {
return true;
}
return false;
I mean, in-so-far as I know, you could be using an out of date version of phpseclib and the issue could be fixed, but let's get the error first lol. |
i have a project to use phpseclib connect cisco and H3C Swtich device .
these devices' passowrd are not different.so i must try to test these password ,when i first login these device.
i write some code to find the correct password in the password list,but the correct password is only effect when it's first used to login .
The text was updated successfully, but these errors were encountered: