- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- chmod -R 777 from / as root
Operating System - HP-UX
1822320
Members
5482
Online
109642
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
Forums
Discussions
юдл
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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-31-2001 01:42 AM
тАО03-31-2001 01:42 AM
Hi all,
By mistake chmode -R 777 from / as root was executed. As a result now ,all the files in all the directories have the permission 777.
Hence any user unknowingly or maliciously might delete it. Another problem is that some files had the SetUid bit set on them and some directories had the sticky bit set on them. Now due to chmod command , they are all lost.
Is there any way to recover to the previous state atleast the system related files and directories like /dev, /etc, /stand, /sbin , / etc. If anybody can help me in recovering the permissions to the previous state, it would be grateful.
Thanks and Regards
Thanga
By mistake chmode -R 777 from / as root was executed. As a result now ,all the files in all the directories have the permission 777.
Hence any user unknowingly or maliciously might delete it. Another problem is that some files had the SetUid bit set on them and some directories had the sticky bit set on them. Now due to chmod command , they are all lost.
Is there any way to recover to the previous state atleast the system related files and directories like /dev, /etc, /stand, /sbin , / etc. If anybody can help me in recovering the permissions to the previous state, it would be grateful.
Thanks and Regards
Thanga
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2001 02:27 AM
тАО03-31-2001 02:27 AM
SolutionAlmost all the permissions for your system directories and files are held in Software Distributor. There should be some complex SD command to recommit these permissions but Im loathe if I can remember it.
Anyway, you need to go thru the INFO files for each product under /var/adm/sw/products and check the permissions and then with a simple script you can reset them.
eg. swlist -l bundle shows your main installed bundle should be; HPUXEng64RT (or 32RT). If you do an swlist HPUXEng64RT it lists all the main products which belong to your HP-UX install, eg. OS-CORE, X11, Xserver, etc etc.
For each of these you need to do the following.
Eg. for the main OS-CORE product;
cd /var/adm/sw/products/OS-Core
In there you will see around 30 subdirs for each of the OS-Core filesets. For each one do the following;
cd
In there you will see several files, the one you want is called INFO.
If you do the following command on the INFO File;
grep -e path -e mode INFO
This will list all files and dirs (starting with the dir / ) and their permissions. path is first, mode is after it. Further down the grep will list lots of paths before it gets to a mode, this means all the above paths have the same mode.
Then you should be able to write a script to process this and reset all your permissions. Dont forget to do all the subdirs under /var/adm/sw/products/OS-Core and above for all other installed software.
This is going to take you some time, it may be quicker to restore from backup! But at least all the permissions are there so you can choose which you want to reset or not, I would at least do ALL of OS-Core/*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2001 05:07 AM
тАО03-31-2001 05:07 AM
Re: chmod -R 777 from / as root
Hi Edward,
Thanks a lot for your help.
I wrote a generic awk script to get the path and mode permissions and execute the chmod command. Is there any command provided by HP to revert back these permissions.
Thanx a lot for your help. It was very helpful.
Regards
Thanga
Thanks a lot for your help.
I wrote a generic awk script to get the path and mode permissions and execute the chmod command. Is there any command provided by HP to revert back these permissions.
Thanx a lot for your help. It was very helpful.
Regards
Thanga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2001 09:48 AM
тАО04-02-2001 09:48 AM
Re: chmod -R 777 from / as root
We had the same problem a year ago.
After many heroic efforts that failed we finally retored from a 2 week old make_recovery
tape. This worked. But I had to update the OS
with changes since the tape had been made.
After many heroic efforts that failed we finally retored from a 2 week old make_recovery
tape. This worked. But I had to update the OS
with changes since the tape had been made.
veni, vidi, vmstat
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP