SSH中的通道错误

时间:2013-09-20 09:49:50

标签: mongodb ssh

我希望通过SSH本地端口远程服务器,以便本地和远程同步我的Mongodb,如post所述。

我跑:

ssh -L27018:localhost:27017 REMOTE_SERVER_HERE

但是,当我在不同的终端本地键入该命令以进行访问时:

$ mongo --port 27018

我明白了:

[REMOTE_CONSOLE]\> debug1: Connection to port 27018 forwarding to localhost port 27017 requested.
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
debug1: channel 2: free: direct-tcpip: listening port 27018 for localhost port 27017, connect from 127.0.0.1 port 55428, nchannels 3

如果我在ssh连接终端中运行相同的命令,我得到:

[REMOTE_CONSOLE]\> mongo --port 27018
MongoDB shell version: 2.4.6
url can't have host or port if you specify them individually

这是否意味着我在防火墙后面,远程管理员是否限制了此访问权限或其他内容?

如果是这样,我该如何解决?

1 个答案:

答案 0 :(得分:0)

逻辑错误...远程服务器在127.4.198.2:27017而非localhost:27017运行。