ssh2 icon indicating copy to clipboard operation
ssh2 copied to clipboard

Proxy server with publicKey auth

Open ptorrent opened this issue 2 years ago • 2 comments

Hello there,

Is there a way to forward the publicKey to other ssh server ?

Something like that ?

			 client.on('authentication', (ctx) => {
				else if(ctx.method == 'publickey'){
					connect({
						username 		: ctx.username,
						publicKey 		: ctx.key.data
					}, function(err, session){
						if(err) return ctx.reject()
						ctx.accept()
					})
				}

Not an expert, maybe it's crazy x)

Thanks for your help !

ptorrent avatar Jan 17 '23 15:01 ptorrent

No, there is currently no built-in way to proxy authentication to a third party.

mscdex avatar Feb 02 '23 04:02 mscdex

@mscdex I have the same question. Could you give me some idea on how can I achieve something like this please?

For example, when user connects to ssh2 server, we initiate a client request to another server immediately and proxy/pipe the incoming user connection to the outgoing client connection with another remote server.

Is this even technically possible? If so it would be really helpful if you could give me some hint on how can I get started with editing the source to achieve this. Great thanks for this awesome lib!

nodegin avatar Sep 02 '23 17:09 nodegin