Separate root history files

With the code below put in a kshrc file, each admin that su's into root will have their own root's history file.

When there are multiple administrators to a system, it's very difficult to determine which admin made changes when the root's history file is the same no matter which user su'd to root. With the code below put in a kshrc file, each admin that su's into root will have their own root's history file.
Tty=$(tty|cut -f3-4 -d/)
Per=`last |grep $Tty |head -1 | awk '{ print $1 }' |cut -c 1-5`
HISTFILE=/var/spool/mail/.sh_hist.$Per
This was last published in January 2003

Dig Deeper on Alternative OS security: Mac, Linux, Unix, etc.

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudSecurity

SearchNetworking

SearchCIO

SearchConsumerization

SearchEnterpriseDesktop

SearchCloudComputing

ComputerWeekly

Close