如何通过 sftp 连接到 Midnight Commander 上的非标准端口?

par*_*oid 12 sftp mc

在 Midnight Commander 中,可以使用以下方法与远程机器建立 SFTP 连接:

cd #sh:yourusername@example.com:/home/username/
Run Code Online (Sandbox Code Playgroud)

当远程机器使用非标准端口时,如何做到这一点?

Gil*_*il' 14

每当您想对 ssh 使用非默认设置时,请在~/.ssh/config. 通过这种方式,您可以调用ssh myalias,或者ssh myalias在后台调用一些应用程序,而不必担心如何传递设置,例如非默认端口、不同的用户名等。

Host foo
HostName example.com
Port 2222
User yourusername
Run Code Online (Sandbox Code Playgroud)

然后在午夜指挥官: cd #sh:foo:


par*_*oid 9

我意识到我已经尝试过该解决方案,但它没有用,因为我没有sshd监听我正在使用的 VPN 接口。我现在已经在标准端口上监听了内部接口,所以我什至不再需要这个解决方案,但这里是:

cd #sh:yourusername@example.com:[port]/home/username/
Run Code Online (Sandbox Code Playgroud)


Pab*_*o A 6

mc在相应的“侧边菜单”中支持“外壳链接”。这款采用 ssh建立fish连接(FI乐在转移SH ELL文件系统)。

截屏

mc帮助/手册页

帮助截图

AFAIK 在通过跳转服务器时没有等效于-Jssh 的选项。