LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices



Reply
 
Search this Thread
Old 01-29-2005, 06:42 PM   #1
deoren
Member
 
Registered: Oct 2003
Location: USA
Distribution: Ubuntu
Posts: 214

Rep: Reputation: 30
Bash script to email setuid root files [SOLVED]


Here is a script I just threw together to email me a listing of setuid files. I saved this file in /etc/cron.daily and chmod +x the script.

This way I'll get daily emails telling me what files are setuid root.

Code:
#!/bin/sh

###################################################################
# Script Purpose: Find all executable files with setuid root      #
#      File Name: find_setuid_root.sh                             #
#        Version: 0.1.0                                           #
#    Script Date: 01-29-05                                        #
#       Mod Date:                                                 #
###################################################################


##############################################################
# User set variables
##############################################################
EMAIL_ADDRESS="YOUR.EMAIL@DOMAIN.COM"
EMAIL_SUBJECT="Setuid root files for ${HOSTNAME}, `date '+%m%d%y'`"

##############################################################
# Script begins here
##############################################################

find / -perm +4000 -print -user root | mail -s "${EMAIL_SUBJECT}" ${EMAIL_ADDRESS}

exit 0
I hope this is useful to someone.

I found the find command with needed options here: http://www.iss.net/security_center/a...id/default.htm

Last edited by deoren; 04-11-2005 at 09:38 AM.
 
Old 01-30-2005, 10:56 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Moved: More suitable in our Member Success Stories forum.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to setuid root abridge Linux - Newbie 4 04-06-2005 04:59 PM
Write a script to send an email from bash kpelczar Linux - Software 5 02-09-2005 05:19 PM
Bash script to alert by email 3 times then stop. pmpc00 Linux - General 2 11-04-2004 08:23 AM
bash script to email updated ip ericnmu Linux - Networking 1 10-01-2004 11:30 PM
bash script, parsing email addresses kepler Programming 6 01-26-2004 07:47 AM


All times are GMT -5. The time now is 09:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration