Solved

Chmod 700 etc

Posted on 2009-04-15
6
1,094 Views
Last Modified: 2012-05-06
I accidently do chmod 700 to etc folder in my Redhat EL5...Will i face problem later?
0
Comment
Question by:emlily
  • 4
6 Comments
 
LVL 29

Expert Comment

by:fosiul01
ID: 24146282
yap,

700 meant : Read + write+execute to OWNER

 and other will have NO access to that directory

and /etc hold all the configuration file such as apache, samba and others

so those serivce would not run  
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 24146322
if you have a backup of /etc/ directory then you can try to restore /etc/ directory from backup, it might fixed the problem
0
 

Author Comment

by:emlily
ID: 24146333
i have the backup...but when i copy /backup/etc to /etc...even i used force command...i still ask y or n
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 29

Expert Comment

by:fosiul01
ID: 24146390
what commadn you using

cp  -Rf  should work forcefully.




0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 125 total points
ID: 24146613

Hi,
if you have a backup directory, there is a simpler way to restore permissions. Run the following commands against your backup directory and run the resulting script against your original  directory (verify the correctness of the script's contents before running it!) -

cd /backup
echo "#!/bin/ksh" > /tmp/chmodscript.sh
find ./etc | xargs -i{} stat -c "%a %n" {} | awk '{print "chmod", $1, $2}' >> /tmp/chmodscript.sh
echo "exit" >> /tmp/chmodscript.sh
chmod +x /tmp/chmodscript.sh  
cd /
/tmp/chmodscript.sh  

Note that the cd - statements (in bold above) are very important for this to work!

Good luck!
wmp
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 24147127
yap good script....
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now