简体   繁体   English

Qt QProcess读取ssh详细输出

[英]Qt QProcess read ssh verbose output

I managed to read ssh verbose mode output with QProcess. 我设法用QProcess读取ssh详细模式输出。 But, like in the terminal, if ssh is successfully logged in, it will stop the process. 但是,就像在终端中一样,如果ssh成功登录,它将停止该过程。 But, in the terminal, I can see the verbose output if there are connections using ssh. 但是,在终端中,如果有使用ssh的连接,则可以看到详细的输出。
I make ssh for dynamic forwarding like this command: 我使用以下命令将ssh用于动态转发:

ssh -vfCND31338 -l username -p 22 myhost

the problem is that QProcess will stop reading output when ssh successfully logged in. for the rest verbose, it doesn't read anymore. 问题是,当ssh成功登录后,QProcess将停止读取输出。对于其余的详细信息,它将不再读取。 What should I do with this? 我该怎么办?

I do not think this is possible off-hand with stock Qt, but eg you could poll with a certain interval if the ssh session is still running. 我认为这与股票Qt无关,但是例如,如果ssh会话仍在运行,则可以按一定间隔进行轮询。 In that case, pgrep is your friend. 在这种情况下, pgrep是您的朋友。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM