How to restore standard default permissions on /etc?


 
Thread Tools Search this Thread
Operating Systems HP-UX How to restore standard default permissions on /etc?
# 1  
Old 07-10-2013
How to restore standard default permissions on /etc?

Hello HP Admins,

Somehow Permissions of files inside /etc set to 777 in HP-UX 11. Due to this, system malfunctioning. I would like to know if there exists any command/script that sets all system files (or /etc atleast) to its default standard permissions.

I just don't want to run 755 on /etc as few files need special permissions (with "r" only to root etc.)

Thanks!
# 2  
Old 07-10-2013
minus a better alternative ...

your best bet is to restore the directory from backups as some files in /etc are actually setuid/setgid -- according to my experience a while back -- and a plain chmod 755 will not be sufficient ... good luck!
# 3  
Old 07-15-2013
You can restore some permissions from the package DB:
Code:
find /var/adm/sw/products -type f -name INFO | xargs awk '
$1=="path" && $2~/^\/etc\// {s=10; path=$2}
s==0 {next}
($1=="file" || --s==0) {s=0; if (mode!="") print "chmod",mode,path; mode=""; next}
$1=="mode" {mode=$2}
END {if (mode!="") print "chmod",mode,path}
'

Pipe this to /bin/sh in order to execute it.

Last edited by MadeInGermany; 07-15-2013 at 05:20 PM.. Reason: A small bug fix
# 4  
Old 07-15-2013
Comparing to a different system is also a good option.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Redirect Standard output and standard error into spreadsheet

Hey, I'm completely new at this and I was wondering if there is a way that I would be able to redirect the log files in a directories standard output and standard error into and excel spreadsheet in anyway? Please remember don't use too advanced of terminology as I just started using shell... (6 Replies)
Discussion started by: killaram
6 Replies

2. Shell Programming and Scripting

standard error to standard out question

Hi there how can i get the result of a command to not give me its error. For example, on certain systems the 'zfs' command below is not available, but this is fine becaues I am testing against $? so i dont want to see the message " command not found" Ive tried outputting to /dev/null 2>&1 to no... (5 Replies)
Discussion started by: hcclnoodles
5 Replies

3. Shell Programming and Scripting

Shell Script to save/restore files and dir permissions

Hello all: I need found script to save and restore file permissions and owner:group... this is for backup my server... I have one problem in my server and file permissions and owner:group, mess up.. For this reason i need found one way to secure this aspect of the server... Thanks! (1 Reply)
Discussion started by: joangopan
1 Replies

4. AIX

mksysb restore - Wrong OS level for restore

Hi all, I am still working on my mksysb restore. My latest issue is during an alt_disk_install from tape I got the following error after all the data had been restored. 0505-143 alt_disk_install: Unable to match mksysb level 5.2.0 with any available boot images. Please correct this... (0 Replies)
Discussion started by: pobman
0 Replies
Login or Register to Ask a Question