Skip to content
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

Export ask password interactively #119

Closed
somzoli opened this issue Jun 27, 2024 · 5 comments
Closed

Export ask password interactively #119

somzoli opened this issue Jun 27, 2024 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@somzoli
Copy link
Contributor

somzoli commented Jun 27, 2024

Hi!

If i use code example below, the export query ask password interactively instead using client parameters.
Can you help with this?

use \RouterOS\Client;

// Initiate client with config object
$client = new Client([
    'host'        => '192.168.1.3',
    'user'        => 'admin',
    'pass'        => 'admin',
    'ssh_port'    => 22222,
    'ssh_timeout' => 60, // if not set then 30 seconds by default 
]);

// Execute export command via ssh
$response = $client->query('/export');
// or
$response = $client->export();

var_dump($response);

Thanks!

@somzoli somzoli added the question Further information is requested label Jun 27, 2024
@EvilFreelancer
Copy link
Owner

Hi! Export feature in this library is based on ssh extension, and i guess ssh daemon is not preconfigured on your router.

Can you manually connect via ssh to device with the same username and password?

@somzoli
Copy link
Contributor Author

somzoli commented Jun 27, 2024

Yes, i can able to connect via ssh successfully with same username/password.
When it try to connect through php the login prompt shows this: [email protected]'s password:
After give the correct password, the dump work as expected.
Seems like the 'pass' not used in the library.

@somzoli
Copy link
Contributor Author

somzoli commented Jun 27, 2024

With 'ssh_private_key' option the connection work, but i need password auth if it possible.

@EvilFreelancer
Copy link
Owner

Sounds like something changed in https://github.com/spatie/ssh

I'll check it later, thanks!

@EvilFreelancer
Copy link
Owner

Hi! PR #120 merged, fix available in version 1.5.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants