- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find all setuid files
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
тАО03-29-2006 03:43 AM
тАО03-29-2006 03:43 AM
---S------
------S---
find / -perm -2000 -o -perm -4000 -exec ls -l {} \;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 03:49 AM
тАО03-29-2006 03:49 AM
Re: find all setuid files
I ran the same thing and it returned all appropriate files.
Are you running the command as root?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 03:51 AM
тАО03-29-2006 03:51 AM
Re: find all setuid files
find / -perm 2000 -o -perm 4000 exec ls -ld {} \;
Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 04:00 AM
тАО03-29-2006 04:00 AM
Solutionfind / -type f \( -perm -2000 -o -perm -4000 \) -exec ls -l {} \;
You definitely want the -4000 as opposed to 4000 because 4000 would match only those files with mode 4000 as opposed to 4xxx (where x in this case means means "don't care" rather than execute.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 04:03 AM
тАО03-29-2006 04:03 AM
Re: find all setuid files
I need all permutations of 4xxx, e.q. 4700, 4500, and so on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 04:15 AM
тАО03-29-2006 04:15 AM
Re: find all setuid files
# find / -perm -2000 -o -perm -4000 -exec ll -d {} \;
Are you absolutely SURE you put the '-' in front of the 2000 and 4000 in your original find? If you don't have the '-' it will look for exact permissions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 04:31 AM
тАО03-29-2006 04:31 AM
Re: find all setuid files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 04:36 AM
тАО03-29-2006 04:36 AM
Re: find all setuid files
# find . -type f -perm -u+s
...will find files in the current working directory with the setuid bit on whether or not the owner's execute bit is on ("s") or off ("S").
# find . -type f -perm -g+s
...finds those files whose setgid bit is on regarless of group execution rights.
...and:
# find . -type f -perm -ug+s
...finds files where both bits are on.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 05:33 AM
тАО03-29-2006 05:33 AM
Re: find all setuid files
Here are 2 files I am trying to match. The first command matches none of them, the second just one. How can I fix it to match both of them?
# ll ?
-rwsr-xr-x 1 root sys 5 Mar 29 11:03 a
-rw---Srw- 1 root sys 4 Mar 29 11:41 b
# find . -type f -perm -ug+s
#
# find /data -perm -2000 -o -perm -4000 -exec ls -l {} \;
-rwsr-xr-x 1 root sys 5 Mar 29 11:03 /data/a
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 05:41 AM
тАО03-29-2006 05:41 AM
Re: find all setuid files
If you re-read my first post, then for:
-rwsr-xr-x 1 root sys 5 Mar 29 11:03 a
-rw---Srw- 1 root sys 4 Mar 29 11:41 b
For file "a" to match use:
# find . -type f -perm -u+s
For file "b" to match, use:
# find . -type f -perm -g+s
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 05:46 AM
тАО03-29-2006 05:46 AM
Re: find all setuid files
find / -type f \( -perm -2000 -o -perm -4000 \) -exec ls -l {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 05:46 AM
тАО03-29-2006 05:46 AM
Re: find all setuid files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 05:49 AM
тАО03-29-2006 05:49 AM
Re: find all setuid files
What's the latest "find" patch?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 05:50 AM
тАО03-29-2006 05:50 AM
Re: find all setuid files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2006 06:21 AM
тАО03-29-2006 06:21 AM
Re: find all setuid files
PHCO_2564 for those who are interested.
I do not have it installed.
It doesn't seem to affect anything in the context of this discussion.