Solved

Chmod 700 etc

Posted on 2009-04-15
6
1,112 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
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)

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

856 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