- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- chmod for SGID
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
07-11-2002 04:08 AM
07-11-2002 04:08 AM
I have a filesystem which traverses deep down the hierarchy i.e as follows:
/cpu/processor/doc/proj1/tmp/layout/design
I would like to remove the SGID for all files only, and not directories in this filesystem.
I would like the files to have the following permission settings:
rwxr-xr-x
and not rwxr-sr-x
I did the following:
find . -type -f -exec chmod g-s {} \;
However, the files still have the SGID bit set i.e :
rwxr-sr-x
and some files which were having:
rwxr-xr-x
have now been changed to rwxr--r--
Could somone help me out?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 04:20 AM
07-11-2002 04:20 AM
Re: chmod for SGID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 04:23 AM
07-11-2002 04:23 AM
Re: chmod for SGID
Also you may want to limit the search to only SGID files. This will limit any messups. Use the perm option with the 2000 permission.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 04:27 AM
07-11-2002 04:27 AM
Re: chmod for SGID
Could you tell me how I should use the use the perm opt with 2000 permission?
Could you show me how I could limit the search to just the SGID files?
I'm really in a hurry to get this task done.
Appreciate it if you could help me out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 04:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 04:42 AM
07-11-2002 04:42 AM
Re: chmod for SGID
for the next time, type :
find . -type f -perm 2755 -exec chmod g-s {} \;
2755 = rwxr-sr-x
for fix your problem type :
find . -type f -perm 745 -exec chmod g+x {} \;
find . -type f -perm 744 -exec chmod g+x {} \;
745 = rwxr--r-x
744 = rwxr--r--
for a file with rigth rwxr-xr-x, the command
chmod g-s give the result rwxr--r-x
for test before execute chmod, type :
find . -type f -perm 745 -exec ls -l {} \;
Good luck
Jean-Yves
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 04:48 AM
07-11-2002 04:48 AM
Re: chmod for SGID
I did :
find . -type f -perm -2000 -exec chmod 755 {} \;
But it did not work. I need to have the permission mode set to 755 i.e rwxr-xr-x
Could you help me out?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 05:32 AM
07-11-2002 05:32 AM
Re: chmod for SGID
find . -type f -perm -2000 -exec chmod 755 {} \;
will take all the files with the SGID permission set and change the permissions to 755. You may want to use the find with the permission setting 0744 and chmod to 755.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 05:41 AM
07-11-2002 05:41 AM
Re: chmod for SGID
else
#find . -type f -perm -2000 -exec chmod 0755 {] \;
Make sure that you are in the proper directory.
find . will show only the current directory.
find ./ will traverse directories beneath.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 05:43 AM
07-11-2002 05:43 AM
Re: chmod for SGID
find .
also changes the directories beneath.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 06:15 PM
07-11-2002 06:15 PM
Re: chmod for SGID
I've tried all the options provided, however, SOME files in SOME directories still have the permissions set to :
rwxr-Sr-x
I really do not understand why aren't all files have the SGID removed.
Unless I do it manually as
#chmod g-s filename
only then it works for some files.
I really do not understand the problem in my script which is causing this problem for some files.
Could someone help me out?
Thanks.