Skip to content

Commit

Permalink
Add comment/documentation on why .bash_history is cleared by default (#…
Browse files Browse the repository at this point in the history
…2604)

* Update history.sh

Add comment/documentation on why .bash_history is cleared

Signed-off-by: Patrick Robertson <[email protected]>

* Add comment about history.sh to bash_profile as well (#1)

Signed-off-by: Patrick Robertson <[email protected]>

---------

Signed-off-by: Patrick Robertson <[email protected]>
Co-authored-by: Daniel Hansson <[email protected]>
  • Loading branch information
pjrobertson and enoch85 authored Jan 15, 2024
1 parent 36be446 commit c3f1e0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions static/change-ncadmin-profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ then
PATH="/home/$UNIXUSER/bin:$PATH"
fi
bash /var/scripts/instruction.sh
# clear .bash_history by default as a security precaution
bash /var/scripts/history.sh
sudo -i
Expand Down
2 changes: 2 additions & 0 deletions static/history.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

# Security measure: clear .bash_history by default on login
# For more info: https://github.com/nextcloud/vm/issues/2481#issuecomment-1529175048
truncate -s0 "$HOME/.bash_history"

exit 0

0 comments on commit c3f1e0d

Please sign in to comment.