- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need to find out whcih script uses su to root
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 06:55 PM
тАО11-25-2009 06:55 PM
Need to find out whcih script uses su to root
My DBA uses a script that will do a su to the DBA user ID from root login and send him some reports by email. This is scheduled by cron. He is not sure which script does that but for the last some days he is not receiving that. There are a lot of crontab entries and it will take a lot of time to analyse each script and find out the exact one. I checked in the /var/adm/sulog file also and cannot find an entry that says "root-orcdba".
Now my request is, could anybody of you suggest me a way to find the scripts that do an su from root to my DBA ID (orcdba). Can we use find command to do this? I believe that most of the scripts DBA use resides in root file system.
Thanks in advance
unixnewbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 07:02 PM
тАО11-25-2009 07:02 PM
Re: Need to find out whcih script uses su to root
# grep "su - orcdba" *.sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 07:28 PM
тАО11-25-2009 07:28 PM
Re: Need to find out whcih script uses su to root
There are lot of scripts in different directories.
I tired
find / -name *.sh -exec grep "/usr/bin/su" '{}' \; -print
but got the following error
find: missing conjunction
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 07:47 PM
тАО11-25-2009 07:47 PM
Re: Need to find out whcih script uses su to root
> find / -name *.sh -exec grep "/usr/bin/su" '{}' \; -print
Yes, it looks exhausted.
find / -name '*.sh' -exec grep '/usr/bin/su' {} \; -print
Quote the stuff which needs quotation, leave
the stuff which needs none.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 10:24 PM
тАО11-25-2009 10:24 PM
Re: Need to find out whcih script uses su to root
find / -name "*.sh" -exec grep -e /usr/bin/su -e su +
Are you sure the script will have the full path instead of just "su"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 10:57 PM
тАО11-25-2009 10:57 PM
Re: Need to find out whcih script uses su to root
Check the mail.log the root and dba mail boxes for errors.
/var/adm/syslog/mail.log
/var/mail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2009 01:24 AM
тАО11-27-2009 01:24 AM
Re: Need to find out whcih script uses su to root
2. Command "crontab -l" should list all jobs called by cron, u mau c useful output with:
# crontab -l |awk '{ print $6 }'
3. find command may miss some hits try different syntax see which one nail it down:
# find / -type f -exec grep -l "su" {} \;
In above example, we check all Regular files looking for "su" but for more granularity replace it with actual path like "/usr/bin/su".
HTH/T#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2009 07:01 AM
тАО11-27-2009 07:01 AM
Re: Need to find out whcih script uses su to root
# grep -e su ../crontab.root *
Unix operates with beer.