How to Mock Net::SSH Authentication Scheme

34 views
Skip to first unread message

Tiago Cardoso

unread,
Mar 6, 2014, 3:27:20 AM3/6/14
to capis...@googlegroups.com
I'm having some problems setting my tests up to test an ssh client connection. Basically I'm setting a kind of "SSH Server" on another process, binding it to a port, and telling my connection client to connect to that port. The client uses Net::SSH. Problem is, when it binds, it expects the whole SSH authentication protocol messages back and forth (SSH Version, key exchange, bla bla bla...). I would like either to replicate that behaviour on my server (quite difficult, haven't seen that anywhere) or at least mock the Net::SSH authentication scheme so that it bypasses it and uses an unencrypted channel (just for testing purposes, as stated).

I know this is not the best channel to discuss this, but I haven't found any net-ssh discussion group, and since capistrano does use Net::SSH extensively and tests its code, I would like to know if somebody has ever stumbled on this issue, maybe there is a best solution for this.

Lee Hambley

unread,
Mar 6, 2014, 5:34:44 AM3/6/14
to capistrano
Hi Tiago,

I can't imagine why you aren't just using SSH normally. I can't say I've ever had the problem. In cases where I've needed to test something, I have started opensshd in another process in a chroot jail, and examined the filesystem changes from outside.

Using SSH without authentication isn't really using SSH.
On 6 March 2014 09:27, Tiago Cardoso <honeyry...@gmail.com> wrote:
I'm having some problems setting my tests up to test an ssh client connection. Basically I'm setting a kind of "SSH Server" on another process, binding it to a port, and telling my connection client to connect to that port. The client uses Net::SSH. Problem is, when it binds, it expects the whole SSH authentication protocol messages back and forth (SSH Version, key exchange, bla bla bla...). I would like either to replicate that behaviour on my server (quite difficult, haven't seen that anywhere) or at least mock the Net::SSH authentication scheme so that it bypasses it and uses an unencrypted channel (just for testing purposes, as stated).

I know this is not the best channel to discuss this, but I haven't found any net-ssh discussion group, and since capistrano does use Net::SSH extensively and tests its code, I would like to know if somebody has ever stumbled on this issue, maybe there is a best solution for this.

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/a27e75ec-1124-4545-9152-9cf99e1193e0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages