... | ... | @@ -31,6 +31,27 @@ Good practice is to not plain text user information and have it stored else wher |
|
|
```bash
|
|
|
$ mysql -u "$DB_USER" -p "$DB_PASSWORD" # This is better practice.
|
|
|
```
|
|
|
|
|
|
##Filtering Commands
|
|
|
You can filter commands from being recorded to Bashhub via a regex set to the environment variable `BH_FILTER`. These commands will be ignored and omittted from Bashhub.
|
|
|
|
|
|
```bash
|
|
|
# Filter out any commands for postgres or ssh
|
|
|
export BH_FILTER="(psql|ssh)"
|
|
|
ssh rcaloras@some-ip-address # will not be saved
|
|
|
```
|
|
|
|
|
|
You can check the configuration of this command via the `bashhub filter` subcommand.
|
|
|
|
|
|
```bash
|
|
|
# Check if a command is filtered by my regex
|
|
|
export BH_FILTER="(-p)"
|
|
|
bashhub filter "mysql -u root -p plain-text-password"
|
|
|
BH_FILTER=(-p)
|
|
|
mysql -u root -p plain-text-password
|
|
|
Is Filtered. Matched ['-p']
|
|
|
```
|
|
|
|
|
|
Lastly `#ignore` added to any command will omit it from being saved. Simply add it to the end of any command and it won't be recorded in Bashhub.
|
|
|
|
|
|
```bash
|
... | ... | |