- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HPUX 11i - how to check for correct system file pe...
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
10-20-2007 08:12 AM
10-20-2007 08:12 AM
The command was running for approx 30 seconds before the error was spotted by the administrator. System seems OK, but nervous about a reboot.
Any help/pointers appreciated and rewarded!
Simon
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2007 08:29 AM
10-20-2007 08:29 AM
Solution# swverify -F \*
...will fix all permissions and ownership along with checking the checksum of all installed products. By "installed", of course, I mean those installed with 'swinstall' and thus recorded in the Installed Product Database ('/var/adm/sw').
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2007 05:53 PM
10-21-2007 05:53 PM
Re: HPUX 11i - how to check for correct system file permissions
If there are many files with incorrect permissions, it is easiest to run
swverify(1M) with a wildcard that will check all the files on the system:
# swverify -v -x fix=true \*
For further information see the swverify man page:
fix=false If true, runs vendor-specific scripts to correct and
report problems on installed software. Fix scripts can
create missing directories, correct file modifications,
(mode, owner, group, major, minor), and recreate
symbolic links. If false, fix scripts are not run.
WK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2007 12:46 AM
10-22-2007 12:46 AM
Re: HPUX 11i - how to check for correct system file permissions
The -R option in chmod and chown is the most dangerous option there is for system integrity. Note also that the command chmod -R 777 not only sets execute bits on files that should not have the bit set, it also opens every directory to massive mistakes where anyone an remove or rename files without any restrictions.
I have never seen a situation where 777 was the correct permission for a bunch of files.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2007 02:20 AM
10-22-2007 02:20 AM
Re: HPUX 11i - how to check for correct system file permissions
Agree with Bill.
http://www.hpux.ws/?p=12
In there is a link to one of Bill's presentations that contains code for checking permissions. This will identify stuff missed by the swverify -F
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2007 03:17 AM
10-22-2007 03:17 AM
Re: HPUX 11i - how to check for correct system file permissions
The example below was for "/usr". You mention that "/" was affected. I would imagine it will take a nice long time for this to complete when done at the root level.
Restoring Default File Permissions/Ownership:
Somebody did a "chmod -R 777 /usr" for some reason. Now you need to restore all the files to whatever perms and ownership they originally had.
I assume your on the server in at least init level 2. Do this chmod so we can start fixing this mess.
/sbin/chmod ugo+rx /usr/bin/cut /usr/bin/expand /usr/bin/grep /usr/sbin/swlist
Then this:
comp="/usr"
(or this if there is more than one directory messed up)
comp=' -e ^/usr -e ^/var -e ^/sbin/init.d'
And away we go...
swlist -l file -a type -a path -a mode -a owner -a group | expand | grep \
$comp | cut -f 2 -d : | /sbin/awk '{if(length($2) < 2 && $4 > 0) \
print "/sbin/chmod "$4,$3";/sbin/chown " $5":"$6,$3}' | /sbin/sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2007 08:20 PM
10-22-2007 08:20 PM
Re: HPUX 11i - how to check for correct system file permissions
After a nervous few hours, it appears that very few files were affected and the commands/advice given was excellent.
Thankyou again.
Sincerely,
Simon.