- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: auditing file permissions
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
Forums
Discussions
Discussions
Discussions
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
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
05-24-2006 09:06 AM
05-24-2006 09:06 AM
auditing file permissions
I have been tasked with eliminating the rwx permissions, if possible, for the world user from files on my HPUX 11.i server.
I need a way to:
1 - Find every file with RWX for world on the server.
2 - Record the file name/permissions in case I need to restore them.
3 - A way to restore just the permissions of a file.
Any suggestions?
Thanks!
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2006 09:29 AM
05-24-2006 09:29 AM
Re: auditing file permissions
cp /dev/null /tmp/global.txt
find / -perm a=rwx -exec ll {} >> /tmp/global.txt \;
Restoring the permissions may be a little tricky? I'll have to think about that one. However, I'm leaving for the evening. Hopefully I can get back to this tomorrow.
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2006 09:36 AM
05-24-2006 09:36 AM
Re: auditing file permissions
Do something like this:
# cd /path
# find . -type f -perm -o+x -exec ls -l {} \;
...substitute "-o+r" and "-o+w for read and write permission for "others". Alternately, you can do:
# cd /path
# find . -type f \( -perm -o+x -o -perm -o+r -o -perm -o+w \) -exec ls
This will offer any file that has *either* execure, read, or write permissions for "others".
You can redirect the output to a file that you can reference.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2006 09:44 AM
05-24-2006 09:44 AM
Re: auditing file permissions
find . -perm -0007 -exec ls -lad {} \;
Because a ls -l or ll in for a directory will display the files on that directory, with incorrect results, and you should not use -type f if you want to find directories also.
Redirect the command to a file if you want a list of the files.
find . -perm -0007 -exec ls -lad {} \; > filelist.out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2006 09:45 AM
05-24-2006 09:45 AM
Re: auditing file permissions
Oh, and the last question of restoration.
If you create a simple archive of file names in each category like:
# cd /path && find . -type f -perm -o+x -print > /tmp/xonlyfiles
...Then to remove the e(x)ecute permission for "others":
while read LINE
do
chmod o-x ${LINE}
done < /tmp/xonlfiles
...and to restore the e(x)ecute permissions:
while read LINE
do
chmod o+x ${LINE}
done < /tmp/xonlfiles
Regards!
...JRF...