Comments (13)
What ssh server, server version, and OS/platform is this with?
from ssh2.
It's an appliance for measuring power consumption of connected servers.
a PDU with an ethernet port in fact (product named HP SL APM).
The trick is that I can connect to it using other SSH command line clients (either Putty on Windows or ssh on linux) and I get the output of the command I'm using.
from ssh2.
Have you tried starting an interactive session with shell()
instead of performing a one-off command execution with exec()
?
from ssh2.
Just tried it. I now get the banner and prompt of the "server", but then I'm locked (cannot type anything except Break it). Is this a question of tty setup ?
from ssh2.
Hrmm, so maybe the server does not support exec()
. I'm curious as to what the server claims to be though. Can you install the master branch (npm install https://github.com/mscdex/ssh2/tarball/master
) and then set 'debug: console.login the object passed to
connect()`? You will see the server identification string near the beginning of the output, post that whole string here.
With regards to shell()
, how it works is you're given a "duplex" stream. So if you want to send keystrokes, you have to stream.write()
them (including a newline at the end when entering commands).
from ssh2.
Sorry, I had to go after other priorities for a few days.
Here's what util.inspect got me on the connection object:
_server_ident_raw: 'SSH-1.99-IPSSH-6.6.0'
from ssh2.
Hrmm... not enough information out there on that server software and definitely no free/open source code available (being a part of vxworks).
Can you post the entire debug output?
from ssh2.
I wonder if this patch on top of the current master branch would help any.
from ssh2.
Hi Brian,
Sorry, I'm not a node.js expert developper. I am more a sysadmin trying to
improve my skills with this language that I find very interesting.
Could you please detail how I can generate the kind of output you're
waiting for ?
Regards,
Pascal
2013/5/25 Brian White [email protected]
I wonder if this patchhttps://gist.github.com/mscdex/c639b997314d64535688on top of the current master branch would help any.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-18447697
.
Pascal Rabier
https://twitter.com/R3z0lv3R
France - Europe - World
from ssh2.
Install from the master branch and use the uptime exec example you were trying initially: npm install https://github.com/mscdex/ssh2/tarball/master
. I'm curious to see if it works after I landed that patch.
from ssh2.
Not sure if this is related but I notice that for some commands stream.exit is firing before it finishes receiving data
Connection :: connect
Connection :: ready
Stream :: exit :: code: 0, signal: undefined
Stream :: data
16:26:44 up 4:34, 1 user, load average: 0.00, 0.01, 0.05
Stream :: EOF
Stream :: close
Connection :: end
Connection :: close
if I use stream.data to collect the output lines and wait for stream.end then I have the output proper but if you expect the output to be finished at stream.exit you get nothing.
Oh and yes I tested with master too
from ssh2.
For commands such as uptime and uname -a, exit will fire before EOF
but if you try something like ping -c4 google.com
it looks in order
Connection :: connect
Connection :: ready
Stream :: data
Stream :: data
Stream :: data
Stream :: data
Stream :: data
Stream :: data
Stream :: EOF
Stream :: exit :: code: 0, signal: undefined
PING google.com (74.125.237.128) 56(84) bytes of data.
64 bytes from syd01s13-in-f0.1e100.net (74.125.237.128): icmp_req=1 ttl=58 time=2.13 ms
64 bytes from syd01s13-in-f0.1e100.net (74.125.237.128): icmp_req=2 ttl=57 time=2.38 ms
64 bytes from syd01s13-in-f0.1e100.net (74.125.237.128): icmp_req=3 ttl=57 time=2.54 ms
64 bytes from syd01s13-in-f0.1e100.net (74.125.237.128): icmp_req=4 ttl=57 time=2.84 ms
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 2.137/2.476/2.840/0.259 ms
Stream :: close
Connection :: end
Connection :: close
from ssh2.
@dstrek That is expected behavior just like with node's child_process.spawn(). The 'close' event is what signals that all i/o streams are closed.
from ssh2.
Related Issues (20)
- `Handshake failed: no matching host key format` on `ssh-keyscan` HOT 2
- Difference between forwardout and manual net connect HOT 1
- [HELP] How can i convert private key .ppk to .pem. HOT 2
- Cyberark HOT 1
- Output cut off in the middle during a stream HOT 1
- Command not found when I use ssh2 HOT 2
- forwardOut method local port forward doesn't work? HOT 2
- how to choose between shell or exec function ? HOT 3
- How to pass parameters to ssh2? HOT 1
- ssh key
- Terrapin advice HOT 2
- Vulnerability CVE-2023-48795 Reported: Prefix Truncation Attack, Fix Requested HOT 2
- Pure JS fallback when WASM is not available
- Can't connect "ignoring handled error" HOT 9
- any method to execute command after ssh connected. HOT 10
- Get remote port forwarding -R local port HOT 2
- Question: HTTPSAgent reuse HOT 3
- Execute ssh command inside a "for of" HOT 7
- Test code should be excluded from the published package HOT 1
- Question: Missing documentation in the code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssh2.