我正在使用 MobaXterm v20.6 build 4532 通过 SSH 连接到 Linux 机器。我试图通过双击在左侧的 Scp 面板中打开一个文件,这会弹出一个对话框,上面写着“打开文件时请稍候......”,它永远卡在这里。
有趣的是,这适用于某些服务器,但不适用于其他服务器。有没有办法调试这个?是否有显示 MobaXterm 尝试运行的 scp 命令的日志文件?
我解决了这个问题。我能够通过运行“MobaXterm.exe -log”来启用日志记录。这在 C:\Users\jdoe\Documents\MobaXterm\MobaXterm.log 中留下了一个日志。这是在我尝试打开文件时打印的:
[11:31.39.305] (SSH-Browser) Starting MobaSCP(2, OpenFile, /local/jdoe/.bashrc, C:\Users\JDOE\DOCUME~1\MobaXterm\slash\RemoteFiles\526608_2_0\.bashrc)
[11:31.39.307] BEGIN ShellExecuteA(C:\Users\JDOE\DOCUME~1\MobaXterm\slash\bin\MobaSCPOpenFile.exe, -v -batch -scp -load "TERM5266082" mobauser@mobaserver:"/local/jdoe/.bashrc" "C:\Users\JDOE\DOCUME~1\MobaXterm\slash\RemoteFiles\526608_2_0\.bashrc")
[11:31.39.308] ShellExecuteA: ShellExecuteEx succeeded.
[11:31.39.308] END ShellExecuteA(C:\Users\JDOE\DOCUME~1\MobaXterm\slash\bin\MobaSCPOpenFile.exe, -v -batch -scp -load "TERM5266082" mobauser@mobaserver:"/local/jdoe/.bashrc" "C:\Users\JDOE\DOCUME~1\MobaXterm\slash\RemoteFiles\526608_2_0\.bashrc")
[11:31.39.405] [MobaSCP2] Multiplex=0
[11:31.39.406] [MobaSCP2] HOSTNAME: 192.168.1.104
[11:31.39.406] [MobaSCP2] USERNAME: jdoe
[11:31.39.724] Received verification request for hostkey: ssh-ed25519@22:192.168.1.104
[11:31.39.724] Hostkey corresponds to the cached one
[11:31.39.748] WMNewTab2: Saving sshkey and NOT CONNECTING SSH-Browser...
[11:31.39.748] BEGIN SavePassword
[11:31.39.749] END SavePassword
[11:31.39.845] [MobaSCP2] Using SCP1
[11:31.39.845] [MobaSCP2] Connected to 192.168.1.104
[11:31.39.845] [MobaSCP2] Protocol error: Expected control record
看起来“预期的控制记录”错误是由我的 .bashrc 打印输出引起的。显然这让 SCP 感到困惑:https ://documentation.help/PuTTY/faq-pscp-protocol.html
我可以通过将 .bashrc 更改为不打印任何内容来解决此问题。