Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
ANN: ssh2 module
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  24 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mscdex  
View profile  
 More options Nov 11 2012, 6:00 pm
From: mscdex <msc...@gmail.com>
Date: Sun, 11 Nov 2012 15:00:07 -0800 (PST)
Local: Sun, Nov 11 2012 6:00 pm
Subject: ANN: ssh2 module
Hello all!

I'm announcing the first version of my ssh2 module, now available on
npm.

ssh2 aims to be a complete SSH2 client written in pure JavaScript that
implements the SSH2 protocol (it does not shell out to a command-line
ssh client).

Currently it can execute one-off commands and start interactive shell
sessions. There are still several things to be implemented and
tweaked, but I think it's at least in a fairly usable and stable state
now.

Feel free to give it a whirl and report any bugs you may come across.

https://github.com/mscdex/ssh2 (`npm install ssh2`)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Kocharin  
View profile  
 More options Nov 11 2012, 6:13 pm
From: Alex Kocharin <a...@kocharin.ru>
Date: Mon, 12 Nov 2012 03:12:55 +0400
Local: Sun, Nov 11 2012 6:12 pm
Subject: Re: [nodejs] ANN: ssh2 module
Hi mscdex,

What about the server part? I've seen plenty of ssh clients, but I couldn't find an appropriate node ssh server module, so that could be useful.

--
// alex

12.11.2012, 03:00, "mscdex" <msc...@gmail.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Nov 11 2012, 6:59 pm
From: mscdex <msc...@gmail.com>
Date: Sun, 11 Nov 2012 15:59:26 -0800 (PST)
Local: Sun, Nov 11 2012 6:59 pm
Subject: Re: ANN: ssh2 module
On Nov 11, 6:13 pm, Alex Kocharin <a...@kocharin.ru> wrote:

> What about the server part? I've seen plenty of ssh clients, but I couldn't find an appropriate node ssh server module, so that could be useful.

I'm not really interested in writing an SSH server. Also, the other
SSH clients that are out there currently merely spin up 'ssh' as a
child process which isn't very efficient or easy to work with. My ssh2
module implements the SSH 2.0 protocol itself, so there are no child
processes involved.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Rajlich  
View profile  
 More options Nov 11 2012, 8:26 pm
From: Nathan Rajlich <nat...@tootallnate.net>
Date: Sun, 11 Nov 2012 17:25:37 -0800
Local: Sun, Nov 11 2012 8:25 pm
Subject: Re: [nodejs] Re: ANN: ssh2 module
Very nice stuff Brian!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dhruvbird  
View profile  
 More options Nov 11 2012, 11:24 pm
From: dhruvbird <dhruvb...@gmail.com>
Date: Sun, 11 Nov 2012 20:24:36 -0800 (PST)
Local: Sun, Nov 11 2012 11:24 pm
Subject: Re: ANN: ssh2 module

Really interesting - and useful!

Curious to know why you need both pub & priv key instead of just the
priv-key.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Nov 12 2012, 1:23 am
From: mscdex <msc...@gmail.com>
Date: Sun, 11 Nov 2012 22:23:28 -0800 (PST)
Local: Mon, Nov 12 2012 1:23 am
Subject: Re: ANN: ssh2 module
On Nov 11, 11:24 pm, dhruvbird <dhruvb...@gmail.com> wrote:

> Curious to know why you need both pub & priv key instead of just the
> priv-key.

Currently AFAIK there is no way to generate a public key from a
private key with the existing crypto API. With that in mind, I am
planning on eventually doing the required calculations myself, but
there are other items on the TODO that have a higher priority at the
moment.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Nov 15 2012, 9:25 am
From: mscdex <msc...@gmail.com>
Date: Thu, 15 Nov 2012 06:25:11 -0800 (PST)
Local: Thurs, Nov 15 2012 9:25 am
Subject: Re: ANN: ssh2 module
v0.0.2 is now out on npm and supports more functionality, including:

* port/connection forwarding in both directions

* sending local terminal window resize notifications to the server

* sending POSIX signals to the server

* encrypted private keys

* stream cipher support


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Caswell  
View profile  
 More options Nov 15 2012, 12:24 pm
From: Tim Caswell <t...@creationix.com>
Date: Thu, 15 Nov 2012 11:24:18 -0600
Local: Thurs, Nov 15 2012 12:24 pm
Subject: Re: [nodejs] Re: ANN: ssh2 module

Great work!  I've been wanting something like this for a long time.  One
quick question though.  Is it possible to both spawn a child process and
use it's stdio as raw binary data (no tty metadata) *and* spawn a tty
powered child (like bash -l) in the same connection?  I never could find a
way to do this with shelling out to ssh, but maybe by implementing the
protocol you have more flexibility is what can be done.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Nov 15 2012, 4:21 pm
From: mscdex <msc...@gmail.com>
Date: Thu, 15 Nov 2012 13:20:50 -0800 (PST)
Local: Thurs, Nov 15 2012 4:20 pm
Subject: Re: ANN: ssh2 module
On Nov 15, 12:24 pm, Tim Caswell <t...@creationix.com> wrote:

> Great work!  I've been wanting something like this for a long time.  One
> quick question though.  Is it possible to both spawn a child process and
> use it's stdio as raw binary data (no tty metadata) *and* spawn a tty
> powered child (like bash -l) in the same connection?  I never could find a
> way to do this with shelling out to ssh, but maybe by implementing the
> protocol you have more flexibility is what can be done.

Yes, all of the functionality you see can be done within the same
connection to the server because SSH2 allows multiplexing. For
example, you could have 10 ptys open while executing 75 child
processes and forwarding connections to the server.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt  
View profile  
 More options Nov 15 2012, 5:04 pm
From: Matt <hel...@gmail.com>
Date: Thu, 15 Nov 2012 17:04:21 -0500
Local: Thurs, Nov 15 2012 5:04 pm
Subject: Re: [nodejs] Re: ANN: ssh2 module

You can reuse the same connection with the ssh binary using this in your
.ssh/config:

  ControlMaster auto
  ControlPath /tmp/ssh_mux_%h_%p_%r

The second time you connect to the same host it will re-use the open
connection. Including if you do scp/rsync -e ssh.

(I know that doesn't quite answer your question, but it's a useful tidbit a
lot of people don't know)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Nov 18 2012, 4:38 pm
From: mscdex <msc...@gmail.com>
Date: Sun, 18 Nov 2012 13:38:33 -0800 (PST)
Local: Sun, Nov 18 2012 4:38 pm
Subject: Re: ANN: ssh2 module
v0.1.0 is now out on npm and includes support for SFTP (protocol
version 3 -- what OpenSSH uses (and others use at a minimum)).

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Nov 27 2012, 9:48 am
From: mscdex <msc...@gmail.com>
Date: Tue, 27 Nov 2012 06:48:16 -0800 (PST)
Local: Tues, Nov 27 2012 9:48 am
Subject: Re: ANN: ssh2 module
v0.1.3 is now out on npm and includes support for ssh-agent
authentication, host fingerprint verification, and automatic
generation of the public key from a private key.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charlie Robbins  
View profile  
 More options Nov 27 2012, 10:17 am
From: Charlie Robbins <charlie.robb...@gmail.com>
Date: Tue, 27 Nov 2012 16:17:24 +0100
Local: Tues, Nov 27 2012 10:17 am
Subject: Re: [nodejs] Re: ANN: ssh2 module

Very nice work mscdex. I owe you a case of beer. Seriously.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Dec 13 2012, 3:29 pm
From: mscdex <msc...@gmail.com>
Date: Thu, 13 Dec 2012 12:29:28 -0800 (PST)
Local: Thurs, Dec 13 2012 3:29 pm
Subject: Re: ANN: ssh2 module
v0.1.8 is now out on npm. Highlights since v0.1.3:

* Various bug fixes
* SFTP has createReadStream and createWriteStream now
* Keepalive support

Also, I wrote a fairly simple little script that uses ssh2 to exec()
on multiple servers in parallel for those who may be interested:
https://gist.github.com/4279365. I've been using it myself to easily
perform one-off tasks like git pulls, updating node, etc.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
马涛  
View profile  
 More options Dec 13 2012, 10:35 pm
From: 马涛 <iwa...@gmail.com>
Date: Fri, 14 Dec 2012 11:35:02 +0800
Local: Thurs, Dec 13 2012 10:35 pm
Subject: Re: [nodejs] Re: ANN: ssh2 module

thanks, and how to enable dynamic forward port like "ssh -D1080", can you
give a demo ?

2012/12/14 mscdex <msc...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Dec 13 2012, 10:57 pm
From: mscdex <msc...@gmail.com>
Date: Thu, 13 Dec 2012 19:57:15 -0800 (PST)
Local: Thurs, Dec 13 2012 10:57 pm
Subject: Re: ANN: ssh2 module
On Dec 13, 10:35 pm, 马涛 <iwa...@gmail.com> wrote:

> thanks, and how to enable dynamic forward port like "ssh -D1080", can you
> give a demo ?

Dynamic port forwarding is not something that is supported by this
module. Basically what that requires is writing a SOCKS proxy
implementation -- something that's really outside the scope of this
project. Once you write that (there may be some SOCKS modules worth
looking at on npm), you can easily hook it up to this module and
initiate the outbound connections using forwardOut() and then piping
the data.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
马涛  
View profile  
 More options Dec 14 2012, 3:52 am
From: 马涛 <iwa...@gmail.com>
Date: Fri, 14 Dec 2012 16:52:35 +0800
Local: Fri, Dec 14 2012 3:52 am
Subject: Re: [nodejs] Re: ANN: ssh2 module

thanks, I‘ll try that

2012/12/14 mscdex <msc...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Cantrell  
View profile  
 More options Mar 4, 12:09 pm
From: Mark Cantrell <mark.e.cantr...@gmail.com>
Date: Mon, 4 Mar 2013 09:09:48 -0800 (PST)
Local: Mon, Mar 4 2013 12:09 pm
Subject: Re: ANN: ssh2 module

Hello,

I've been trying to get a local port forward to work but for some reason I
can not.

For example, using putty, this is how I would create a local port forward:

Local port forward http://localhost:8089/config/  to
http://skynetHost:8080/config/

putty.exe -N -P 443 -L 8089:skynetHost:8080 sshHost -l Demo0 -pw pass123

Here is how I've been trying to use ssh2
createSSHConnectionForward(sshHost, sshPort, sshUsername, sshPassword,
srcHost, srcPort, dstIP, dstPort)

 var Connection = require('ssh2');

    var c = new Connection();
    c.connect({
        host:sshHost,
        port:sshPort,
        username:sshUsername,
        password:sshPassword
    });

    c.on('ready', function() {\
        c.forwardOut('localhost', 8089, 'skynetHost', 8080, function(err,
stream) {
            if (err) throw err;
            console.log('ForwardOut :: ready');

        });
    });

What am I missing?

Please advise
Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Mar 4, 2:03 pm
From: mscdex <msc...@gmail.com>
Date: Mon, 4 Mar 2013 11:03:00 -0800 (PST)
Subject: Re: ANN: ssh2 module
On Mar 4, 12:09 pm, Mark Cantrell <mark.e.cantr...@gmail.com> wrote:

>         c.forwardOut('localhost', 8089, 'skynetHost', 8080, function(err,
> stream) {

Does it work if you use IP addresses instead of hostnames?

Also what do you mean by it doesn't work? Is an error thrown? Are
certain callbacks not executed?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Cantrell  
View profile  
 More options Apr 9, 9:56 am
From: Mark Cantrell <mark.e.cantr...@gmail.com>
Date: Tue, 9 Apr 2013 06:56:23 -0700 (PDT)
Local: Tues, Apr 9 2013 9:56 am
Subject: Re: ANN: ssh2 module

Once we switched sshd back to 22 instead of 443 then everything 'worked' as
expected.  The forwarded port was now available locally.

When using 443 there were no errors, but the forwarded port did not respond
or show up in netstat.  It could have been something in our network.  sshd
was running on ubuntu server.  Once again switching to 22 seems to have
resolved whatever the issue was.

Thanks!
Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Cantrell  
View profile  
 More options Apr 23, 9:02 am
From: Mark Cantrell <mark.e.cantr...@gmail.com>
Date: Tue, 23 Apr 2013 06:02:34 -0700 (PDT)
Local: Tues, Apr 23 2013 9:02 am
Subject: Re: ANN: ssh2 module

Update:443 works fine now too, using ips seems to have resolved whatever
the issue was.

Thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jochen Delabie  
View profile  
 More options Apr 30, 2:27 pm
From: Jochen Delabie <jochendela...@gmail.com>
Date: Tue, 30 Apr 2013 11:27:14 -0700 (PDT)
Local: Tues, Apr 30 2013 2:27 pm
Subject: Re: ANN: ssh2 module

Would be nice if there was a nodejs ssh server, so we can use it to run
tests against.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Apr 30, 2:47 pm
From: mscdex <msc...@gmail.com>
Date: Tue, 30 Apr 2013 11:47:16 -0700 (PDT)
Local: Tues, Apr 30 2013 2:47 pm
Subject: Re: ANN: ssh2 module
On Apr 30, 2:27 pm, Jochen Delabie <jochendela...@gmail.com> wrote:

> Would be nice if there was a nodejs ssh server, so we can use it to run
> tests against.

FWIW here is one that is seeing some active development:
https://github.com/danopia/sshd.js

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Apr 30, 2:49 pm
From: mscdex <msc...@gmail.com>
Date: Tue, 30 Apr 2013 11:49:51 -0700 (PDT)
Local: Tues, Apr 30 2013 2:49 pm
Subject: Re: ANN: ssh2 module
On Apr 30, 2:47 pm, mscdex <msc...@gmail.com> wrote:

> On Apr 30, 2:27 pm, Jochen Delabie <jochendela...@gmail.com> wrote:

> > Would be nice if there was a nodejs ssh server, so we can use it to run
> > tests against.

> FWIW here is one that is seeing some active development:https://github.com/danopia/sshd.js

Also: https://github.com/newmsz/node-ssh-protocol

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »