-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Server Tooling & Methods
It would be desirable to have an explicit option to disable writing mongo shell history to a .dbshell file in the user's home directory. Although this history does not include sensitive information related to authentication, there may be personally identifiable data included in commands or queries.
Possible use cases:
- as a command line parameter for mongo (eg. --nohistory) when connecting to remote servers with sensitive data
- as a variable that can be set in the user or global mongorc.js so it takes effect in every session
A current workaround is to make the .dbshell history file read-only. The mongo shell will continue without error if the .dbshell file cannot be read or written (as per SERVER-26871).
For example, on a Unix-like system:
# Ensure an empty history file echo "" > ~/.dbshell # Remove rwx access to the history file chmod 0 ~/.dbshell