From d1d115a905484bfb0064324a22d4cf69eea74803 Mon Sep 17 00:00:00 2001 From: Doncho Gunchev Date: Sat, 17 Oct 2020 13:23:08 +0300 Subject: [PATCH] Improve security (chmod 0700 bash_history) --- bash/ps-twtty-7.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bash/ps-twtty-7.sh b/bash/ps-twtty-7.sh index a528742..a3e3d59 100755 --- a/bash/ps-twtty-7.sh +++ b/bash/ps-twtty-7.sh @@ -161,7 +161,14 @@ ${PROMPT_COMMAND}" export HISTIGNORE='history:history *' } +# Secure bash history +if [ ! -d "$HOME/bash_history" ]; then + mkdir "$HOME/bash_history" + chmod 0700 "$HOME/bash_history" +fi + twtty + unset twtty fi