Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork897
Executing bulk of short commands in queue#1927
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hey there, Is there a way to decrease time to login process? In this case, I think there is only one way to fasten the authentication — using ssh-agent or pubkey auth, is it right? @terrafrost Will be glad for your tips ❤️ |
BetaWas this translation helpful?Give feedback.
All reactions
ssh-agent wouldn't really help that much. All that really does is give you a way to create a signature with a private key and retrieve the public key corresponding to a private key without being able to actually read that private key. The signatures and key exchange and all that jazz still needs to be done.
Unless you could make it so that the server doesn't randomly generate numbers there's not a whole lot you can do to cache logins. And if you did make it so that the server served up the same random bytes every time then you'd be introducing security vulnerabilities.
I think the best option, in your situation, is going to be to just make it so phpseclib is always running. Do something l…
Replies: 1 comment 1 reply
-
ssh-agent wouldn't really help that much. All that really does is give you a way to create a signature with a private key and retrieve the public key corresponding to a private key without being able to actually read that private key. The signatures and key exchange and all that jazz still needs to be done. Unless you could make it so that the server doesn't randomly generate numbers there's not a whole lot you can do to cache logins. And if you did make it so that the server served up the same random bytes every time then you'd be introducing security vulnerabilities. I think the best option, in your situation, is going to be to just make it so phpseclib is always running. Do something like this: $ssh =newSSH2(...);$ssh->login(...);while (true) {// query MySQL DB for commands or some such$commands = [];foreach ($commandsas$command) {$result =$ssh->exec($command);// save command output in DB }sleep(1);} |
BetaWas this translation helpful?Give feedback.
All reactions
🎉 1
-
I'm think I just get rid of 1 job = 1 exec and just run it in one parent job. Thanks for advice, much appreciated. |
BetaWas this translation helpful?Give feedback.