0

first topic here, so apologies in advance, if I am doing something wrong! Searching with various terms did not yield in useful results, so I would like to ask for your help.

Is it possible to start a new SSH session from the Windows CMD CLI in MobaXTerm (preferably in a new tab) with session output logging?

The long story is that I am trying to offer URL overrides for the ssh:// scheme in KeePass for both PuTTY and MobaXTerm users. With PuTTY, it can be achieved from the CLI with the -sessionlog parameter (e.g. cmd://PuTTY.exe -ssh -sessionlog "%TEMP%\PuTTY_logs\{TITLE}_&Y-&M-&D-&T_putty.log" {USERNAME}@{BASE:RMVSCM} -pw {PASSWORD}). Starting the session in MobaXTerm in a new tab is also doable with e.g. cmd://MobaXterm.exe -newtab "sshpass -p {PASSWORD} ssh -o StrictHostKeyChecking=no {USERNAME}@{URL:RMVSCM}".

However in the MobaXTerm reference, I was not able to find any option to activate logging for the session from the CLI. Is this feasible at all?

Thanks in advance!

2 Answers 2

0

Per https://blog.mobatek.net/post/mobaxterm-command-lines/, there is a -log option, but you can't choose the destination nor the filename.

2
  • Thanks, but that is not what I am looking for: the -log option "can be used to write down some debug information in a log file MobaXterm.log", whereas I would like to log the content/output of the opened SSH session; that is what PuTTY.exe -sessionlog does.
    – scotofil
    Commented Aug 3, 2023 at 12:47
  • @scotofil OK. Session log can be defined in a bookmark. You can start a bookmark from CLI, but you probably can't change the host in the bookmark. Feature request for Mobatek, I guess
    – Mat M
    Commented Aug 4, 2023 at 7:41
0

Actually, turns out that in MobaXTerm, the client-level configuration at Settings -> Configuration -> Terminal tab -> Terminal features section applies. I.e. regardless of how the session is started, if this section is configured to log the SSH session output, it will be logged. This is different in PuTTY, where logging is configured on entry/saved session-level, thus each PuTTY session must be started with logging enabled, whereas a MobaXTerm session can be simply started, and the client-level configuration will determine whether the session is logged.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .