GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - urbanware-org/bashsieve: Script to remove specific Bash history entries upon logout, prevent them from remaining in it

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
CONTACT
CONTACT
 
 
LICENSE
LICENSE
 
 
README
README
 
 
README.md
README.md
 
 
bashsieve.conf
bashsieve.conf
 
 
bashsieve.list
bashsieve.list
 
 
bashsieve.png
bashsieve.png
 
 
bashsieve.sh
bashsieve.sh
 
 

Repository files navigation

BashSieve BashSieve logo

Table of contents

  • Definition
  • Details
  • Usage
  • Contact

Definition

Script to remove specific Bash history entries upon logout, to prevent critical commands and certain terms from remaining in it.

Top

Details

If not disabled or manually cleared, the Bash keeps all the executed commands by writing them into its history file, including lines with passwords in it. For example, when executing

mount -t cifs //192.168.1.24/foobar /mnt -o user=johndoe,pass=S3cr37P455wD

the username, password, and IP address will be kept inside the history unless you manually run the

history -c

command. Otherwise, the mount information remains in it. However, this command will clear the history by deleting all of its entries.

The BashSieve script simply removes specific user-defined Bash history entries on logout and prevents critical information (such as commands, passwords, IP addresses, etc.) from remaining in it.

So far, this tool is still very rudimentary.

Top

Usage

First of all, add the following line at the end the .bashrc file inside of your home directory. For example, in case the BashSieve script is located in /opt/bashsieve:

trap '/opt/bashsieve/bashsieve.sh' exit

Of course, you can also place the script somewhere inside your home directory, but putting it into /opt/bashsieve makes it available for all users.

Edit the bashsieve.list file and add the corresponding commands or terms that should be removed by BashSieve. Details can be found inside that file.

After logging out and logging in again BashSieve will be triggered on every future logout and remove lines with the given terms in them.

Alternatively BashSieve can instantly be enabled by manually reloading your local .bashrc file using

. ~/.bashrc

or via the long form:

source ~/.bashrc

Inside the general system log file (e.g., /var/log/messages or /var/log/syslog) you can see how many history entries BashSieve removed on logout:

Jul  7 11:16:30 foobar johndoe[109482]: bashsieve[johndoe]: Lines removed: 4

If there were none:

Jul  7 11:18:42 foobar johndoe[114604]: bashsieve[johndoe]: No lines to be removed

Top

Contact

Any suggestions, questions, bugs to report or feedback to give?

You can contact me by sending an email to [email protected] or by opening a GitHub issue (which I would prefer if you have a GitHub account).

Further information can be found inside the CONTACT file.

Top

About

Script to remove specific Bash history entries upon logout, prevent them from remaining in it

Topics

bashentrieshistorylinuxpreventremoveshellsieveterminal

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.