help: i screw up with chmod on all the file "/"

why

Verified User
Joined
Jun 22, 2007
Messages
14
Hi,

I accidental su chmod 644 on the root folder '/' ..
this cause most of my thing not working ... ssh,dns,...

now i got most of my critical services running.. http, pop3,imap,smtp, ftp ,dns, directadmin
i got some internal users who running on some web application,,therefore i just chmod most of my users to '755' .

i know this is really bad. Are there anyway to restore all the file with correct permission? or what are the files/folder I need to harden it .. before i decide to re-build everything..

i'm running centos 4.5 . thanks
 
Last edited:
Hey,

A lot depends on the exact command you ran but, here's a quick paste of a CentOS 4.5 box:

drwxr-xr-x 23 root root 4096 Aug 27 09:30 .
drwxr-xr-x 23 root root 4096 Aug 27 09:30 ..
-rw------- 1 root root 10240 Aug 27 21:20 aquota.group
-rw------- 1 root root 11264 Aug 29 13:54 aquota.user
-rw-r--r-- 1 root root 0 Aug 27 09:15 .autofsck
drwxr-xr-x 2 root root 4096 Aug 29 04:02 bin
drwxr-xr-x 4 root root 1024 Aug 27 08:52 boot
drwxr-xr-x 10 root root 6540 Aug 27 09:15 dev
drwxr-xr-x 69 root root 12288 Aug 29 13:54 etc
drwx--x--x 10 root root 4096 Aug 27 21:20 home
-rw-r--r-- 1 root root 0 Aug 29 14:40 .imap
drwxr-xr-x 2 root root 4096 Feb 21 2005 initrd
drwxr-xr-x 12 root root 4096 Aug 29 04:02 lib
drwx------ 2 root root 16384 Aug 27 03:35 lost+found
drwxr-xr-x 4 root root 4096 Aug 27 09:16 media
drwxr-xr-x 2 root root 4096 May 3 00:14 misc
drwxr-xr-x 2 root root 4096 Feb 21 2005 mnt
drwxr-xr-x 2 root root 4096 Feb 21 2005 opt
dr-xr-xr-x 136 root root 0 Aug 27 04:15 proc
drwxr-x--- 5 root root 4096 Aug 28 07:24 root
drwxr-xr-x 2 root root 12288 Aug 29 04:02 sbin
drwxr-xr-x 2 root root 4096 Aug 27 08:36 selinux
drwxr-xr-x 2 root root 4096 Feb 21 2005 srv
drwxr-xr-x 9 root root 0 Aug 27 04:15 sys
drwxrwxrwt 5 root root 4096 Aug 29 13:29 tmp
drwxr-xr-x 16 root root 4096 Aug 27 09:01 usr
drwxr-xr-x 20 root root 4096 Aug 27 08:58 var

David
 
hi,thanks for help.

when i restart my apache2 ,i got this

Code:
#  /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: Warning: SuexecUserGroup directive requires SUEXEC wrapper.
Warning: SuexecUserGroup directive requires SUEXEC wrapper.
...
...
Warning: SuexecUserGroup directive requires SUEXEC wrapper.
Warning: SuexecUserGroup directive requires SUEXEC wrapper.
                                                           [  OK  ]
 
This is my / permission.. by now my user are able to browse some of these folders through their web application ... (eg: gallery2 with support directory browser from server). what are the folder or sub-folder i need to concern the most?

Code:
[root@unaserver01 /]# ls -ald /*
-rw-------    1 root root 16384 Sep  8 09:57 /aquota.group
-rw-------    1 root root 17408 Sep  8 02:17 /aquota.user
-rw-------    1 root root   486 Jun 18 00:49 /backup.cron.txt
drwxr-xr-x    2 root root  4096 Jul 10 04:02 /bin
drwxr-xr-x    4 root root  1024 Jul 10 02:53 /boot
drwxr-xr-x    2 root root  4096 Jan 19  2007 /da
drwxr-xr-x    9 root root  6480 Aug 30 02:08 /dev
drwxr-xr-x   82 root root 12288 Sep  8 02:17 /etc
drwx--x--x   62 root root  4096 Sep  1 18:21 /home
drwxr-xr-x   23 9999 mail  4096 Jan 19  2007 /imap
drwxr-xr-x    2 root root  4096 Feb 22  2005 /initrd
drwxr-xr-x   12 root root  4096 Aug 25 04:02 /lib
drwx------    2 root root 16384 Jan 19  2007 /lost+found
drwxr-xr-x    6 9999 mail  4096 Jan 19  2007 /Maildir
drwxr-xr-x    4 root root  4096 Aug 30 02:08 /media
drwxr-xr-x    3 root root  4096 May  3 13:14 /misc
drwxr-xr-x    2 root root  4096 Feb 22  2005 /mnt
drwxr-xr-x    2 root root  4096 Feb 22  2005 /opt
dr-xr-xr-x  157 root root     0 Aug 30 10:07 /proc
drwxr-x---   17 root root  4096 Sep  7 19:18 /root
drwxr-xr-x    2 root root 12288 Sep  5 03:13 /sbin
drwxr-xr-x    2 root root  4096 Jan 18  2007 /selinux
drwxr-xr-x    2 root root  4096 Feb 22  2005 /srv
drwxr-xr-x    9 root root     0 Aug 30 10:07 /sys
drwxrwxrwt    5 root root 36864 Sep  8 11:54 /tmp
drwxr-xr-x   17 root root  4096 Jul  4 13:38 /usr
drwxr-xr-x   22 root root  4096 Jun 22 15:15 /var
-rwx------    1 root root  2080 Jun 22 11:44 /webmin-setup.out
 
Last edited:
There's a .sh script in DA that restores things like these for most folders.
I just can't remember where it was...

~~~~~~~~~~~~~~~~~~~~~~~
edit:

check: http://help.directadmin.com/item.php?id=173

I can only hope that will cure most of your files :)



ps, yes got aware this thread was 4yrs old, most recently right after posting here ^_^;
I hope my mistake will help a future viewer in need ;)
 
Last edited:
Back
Top