LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 05:42 PM   #1
deoren
Member
 
Registered: Oct 2003
Location: USA
Distribution: Ubuntu
Posts: 216

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 08:38 AM.
 
Old 01-30-2005, 09:56 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

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


Reply



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 On
HTML code is Off



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 04:22 PM.

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
Open Source Consulting | Domain Registration