What does this script do? What does the file called usernames contain? How would
ID: 3772709 • Letter: W
Question
What does this script do? What does the file called usernames contain? How would you get it? Who might be interested in the script? Is there any important infomation you don't get when it executes?
cat usernames | while read name
do
cd /home/$name 2> /dev/null
echo; echo -n "$name:"
grep "cat/home/dshoemak/.bash_history" .bash_history 2> /dev/null
done
My answer: My guess without trying is the script makes a report that lists what commands a list of users use. The script pulls the information from the .bash_history file. This is particulary useful to sysadmins looking for people who had hacked their systems. However, I'm not sure what information you couldn't get.
Explanation / Answer
it just shows you the usernames file data
and changes dirctory from home to dev/null path
prints the value of variable name
and finally find for the file .bash_history.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.