Zyxel XS1930-12HP SSH command over libssh (C++)
Hi,
I am trying to run the SSH command "show pwr" in my program (C++) via SSH connection. I use the libssh for this. I can see in the system log of the switch that the connection works:
"IN authentication: SSH user admin login [IP address = 192.168.0.172]".
When I send the command "show pwr" I receive the "unknown error" (-1). In system log unfortunately nothing is shown here.
If I use a different product instead of Zyxel, everything works fine.
Does anyone have an idea what the problem could be?
0
All Replies
-
Hi @Chris77,
May I know you got the error message when you run your program? Or have you try to SSH to XS1930-12HP and enter the command and get same error message?
Zyxel Melen0 -
Hi @Chris77
Based on your test result, using PuTTY is working fine. And we also tried Tera term and local SSH via Windows command line, they all work well with ZYXEL switch.
Not sure what Libssh did to cause the difference. Since the error is returned by Libssh, maybe they could explain why it happens.
Zyxel Melen0 -
Zyxel_Melen,The libssh I use runs fine. Several projects run without problems. The problem must be something else. I suspect that the switch only supports "interactive" ssh sessions. If I enter the following command in git-bash:ssh admin@192.168.0.10 show pwr
orssh admin@192.168.0.10 "show pwr"
I get the following message from the switch:
"Received disconnect from 192.168.0.10 port 22:2: invalid command pwr."To me it looks like the switch does not support the direct commands.0 -
Hi @Chris77Zyxel switch currently not support this function.We suggest you not to use one line command and build your program step by step.You can reference this post to build your program.We also have an idea post which is suggested by other user, I will help to leave your comment there.Zyxel Melen0
Categories
- All Categories
- 415 Beta Program
- 2.4K Nebula
- 146 Nebula Ideas
- 96 Nebula Status and Incidents
- 5.7K Security
- 262 USG FLEX H Series
- 271 Security Ideas
- 1.4K Switch
- 74 Switch Ideas
- 1.1K Wireless
- 40 Wireless Ideas
- 6.4K Consumer Product
- 249 Service & License
- 387 News and Release
- 84 Security Advisories
- 29 Education Center
- 10 [Campaign] Zyxel Network Detective
- 3.5K FAQ
- 34 Documents
- 34 Nebula Monthly Express
- 85 About Community
- 73 Security Highlight