SSH Error:(SSH) Channel open failure: Connection refused

jessica shared this question 25 days ago
Answered

I've been using NoSQLBooster for several years on a local server, with no issues. Now trying to use SSH to connect to a remote server I am having the following problem:

I am able to "Build SSH Tunnel" to IP.IP.IP.IP: 22, but then it says "Failed" for "Connect to IP.IP.IP.IP."


14:41:04.780 SSH Error:(SSH) Channel open failure: Connection refused


14:41:04.780 *** Connect Error ***

{"lang":"","message":"SSH Error:(SSH) Channel open failure: Connection refused","reason":"CONNECT_FAILED","stack":"Error: (SSH) Channel open failure: Connection refused\n at SSH2Stream.onFailure (/Applications/NoSQLBooster for MongoDB.app/Contents/Resources/app.asar/node_modules/ssh2/lib/client.js:1186:13)\n at Object.onceWrapper (events.js:273:13)\n at SSH2Stream.emit (events.js:182:13)\n at parsePacket (/Applications/NoSQLBooster for MongoDB.app/Contents/Resources/app.asar/node_modules/ssh2-streams/lib/ssh.js:3708:10)\n at SSH2Stream._transform (/Applications/NoSQLBooster for MongoDB.app/Contents/Resources/app.asar/node_modules/ssh2-streams/lib/ssh.js:669:13)\n at SSH2Stream.Transform._read (_stream_transform.js:190:10)\n at SSH2Stream._read (/Applications/NoSQLBooster for MongoDB.app/Contents/Resources/app.asar/node_modules/ssh2-streams/lib/ssh.js:251:15)\n at SSH2Stream.Transform._write (_stream_transform.js:178:12)\n at doWrite (_stream_writable.js:410:12)\n at writeOrBuffer (_stream_writable.js:394:5)\n at SSH2Stream.Writable.write (_stream_writable.js:294:11)\n at Socket.ondata (_stream_readable.js:666:20)\n at Socket.emit (events.js:182:13)\n at addChunk (_stream_readable.js:283:12)\n at readableAddChunk (_stream_readable.js:264:11)\n at Socket.Readable.push (_stream_readable.js:219:10)"}


MongoDB is up and running on the remote server, and I am able to log in and use it via SSH in the terminal. I double-checked that port 22 is open.

Replies (2)

photo
1

This type of connection problem is difficult to solve because we have no way to reproduce and track it locally. Connection refused error is most likely due to a problem with the server-side configuration.

Please check your config, you need to set "AllowTcpForwarding yes` in `/etc/ssh/sshd_conf` at the server.

And, private key supports openSSH format only.

photo
1

Thank you for your response! I understand it's difficult to solve on your end.

I should have mentioned I did ensure that AllowTcpForwarding was set to 'yes' (per this question) and I already reformatted my private key (per this question) -- before I reformatted my private key I was unable to even build the SSH Tunnel :)

I will keep trying and update here if I am ever able to solve.

Leave a Comment
 
Attach a file