Preventing Deleted Characters from Being Recorded in MobaXterm Logs
MobaXterm is a popular terminal emulator and SSH client for Windows that allows users to access remote servers and run commands. By default, MobaXterm keeps a log of all the commands and their output, which can be useful for troubleshooting and auditing purposes. However, there may be situations where you want to prevent certain characters from being recorded in the log files, such as sensitive information like passwords or API keys.
The Problem: Deleted Characters Still Recorded in Log Files
One issue that some users have reported is that even when they delete characters using the backspace or delete key, those characters still appear in the log files. This can be a security concern, as it may expose sensitive information that was intended to be removed.
Solution: Use the MobaXterm Configuration Settings
To prevent deleted characters from being recorded in MobaXterm log files, you can modify the configuration settings. Here's how:
Launch MobaXterm and click on the Settings button in the toolbar.
In the Configuration window, click on the MobaXterm category.
Under the Logging section, uncheck the box for Keep log of all sessions.
Check the box for Keep log of current session.
In the Log file field, enter a name for the log file that includes the
%Y-%m-%dformat specifier, which will ensure that a new log file is created each day. For example, you could use a name likemobaxterm_%Y-%m-%d.log.Click on the Advanced button next to the Log file field.
In the Advanced logging options window, check the box for Enable advanced logging options.
Under the Input/output filters section, check the box for Filter input/output text.
In the Filter rules field, enter the following regular expression:
(?This regular expression will match any sequence of backspace or delete characters that are not preceded or followed by any other characters.
Click OK to save the changes and close the Advanced logging options window.
Click OK to save the changes and close the Configuration window.
How It Works
The regular expression (? matches any sequence of backspace or delete characters that are not preceded or followed by any other characters. The \\x7F and \\x08 sequences represent the sequence of bytes that correspond to the delete and backspace characters, respectively.
When this regular expression is applied to the input/output text, any matching sequences are replaced with an empty string, effectively removing them from the log file. This ensures that deleted characters are not recorded in the log files.
MobaXterm is a popular terminal emulator and SSH client for Windows that allows users to access remote servers and run commands.
By default, MobaXterm keeps a log of all the commands and their output, which can be useful for troubleshooting and auditing purposes.
However, there may be situations where you want to prevent certain characters from being recorded in the log files, such as sensitive information like passwords or API keys.
To prevent deleted characters from being recorded in MobaXterm log files, you can modify the configuration settings by following these steps:
- Launch MobaXterm and click on the Settings button in the toolbar.
- In the Configuration window, click on the MobaXterm category.
- Under the Logging section, uncheck the box for Keep log of all sessions.
- Check the box for Keep log of current session.
- In the Log file field, enter a name for the log file that includes the
%Y-%m-%d format specifier.
- Click on the Advanced button next to the Log file field.
- In the Advanced logging options window, check the box for Enable advanced logging options.
- Under the Input/output filters section, check the box for Filter input/output text.
- In the Filter rules field, enter the regular expression
(?.
- Click OK to save the changes and close the Advanced logging options window.
- Click OK to save the changes and close the Configuration window.
References