PDA

View Full Version : Wrong chmod!!


nox171
16th February 2007, 12:35
Hi everybody,

I'm a little bit in trouble guys!
I was changing permission on a folder to compleate an installation (joomla)
I type in this command:
chown -R -v -f web22_xxxxx:web22 /*
:eek: In this way I changed a lot of files and folder permissions!!
I would like to change only the permission on 1 specific folder (the web folder).
I'm not a linux expert, I'm only trying to do the best of myself...

By the way when I realized that the command was wrong it was to late!!
The command run only for few seconds but now I can't log on my ISPConfig admin console!
I receive this error:

Warning: include(../lib/config.inc.php) [function.include]: failed to open stream: Permission denied in /home/admispconfig/ispconfig/web/login.php on line 30

Warning: include() [function.include]: Failed opening '../lib/config.inc.php' for inclusion (include_path='.:') in /home/admispconfig/ispconfig/web/login.php on line 30

Warning: require_once(login/lib/lang/.lng) [function.require-once]: failed to open stream: No such file or directory in /home/admispconfig/ispconfig/web/login.php on line 31

Fatal error: require_once() [function.require]: Failed opening required 'login/lib/lang/.lng' (include_path='.:') in /home/admispconfig/ispconfig/web/login.php on line 31


The only modified folders that I can see in the console (putty) are with this path

changed ownership of `/home/admispconfig/ispconfig/web/phpmyadmin/themes/original/img/b_lastpage.png' to web22_xxxxxx:web22


Do you know if exists an easy way to go back??
I really don't know what I can do!

Please help, :( :eek:
Thanks

/nox

martinfst
16th February 2007, 12:37
chown -R -v -f web22_xxxxx:web22 /*This effectively started your command from the top level root directory. Everything is now changed. There is almost no way to recover except a complete reinstall. Sorry.

nox171
16th February 2007, 12:41
But,
do you know in which way it start to edit the permission?
Starting in alphabetic order or something like that?

I have another server that have the same installation.
Perhaps I can try to change again the permission one by one spotting them on the other server.
The problem is that I need to know where to start... :(

Also can you tell me the right command to edit the permission on one specific folder?

Thanks

alexillsley
16th February 2007, 12:41
You could try setting the owner to root, do know if it would work:rolleyes:

nox171
16th February 2007, 12:44
I would try to recover the situation... not destroy everything... Actually i wouldn't like to re-install again!

nox171
16th February 2007, 12:50
ok...
looking to the other server I can see the folders where I've changed the permission.

Now I'd like to know the right command to edit permission...

Thanks!!!

martinfst
16th February 2007, 13:02
chown normally starts with the lowest numbered i-node. See this as a unique identifier. The way i-nodes are numbered differ from system to system, even if you use the same installation/distro.

If you want to compare everything manually, open three ssh sessions, one to your working system (system A), two to your corrupted system (system B). Type cd /
ls -al | lesson screen of system A and one screen of system B. Compare each and every line. On the second screen of system B, use chown right_user.right_group <full file name>to set the owner/group correctly.
Do all this as user 'root'. Be prepared to work on this for about two days, depending how much you installed.

nox171
16th February 2007, 13:15
Right thanks
I've just started.

I found something like that:

server1:/bin # chown root:root /bin/*
server1:/bin # ls -la
total 6224
drwxr-xr-x 2 root root 4096 Dec 10 20:23 .
drwxr-xr-x 20 root root 4096 Jul 17 2006 ..
-rwxr-xr-x 1 root root 3472 Sep 13 2005 arch
-rwxr-xr-x 1 root root 110912 Sep 9 2005 ash
-rwxr-xr-x 1 root root 584652 Sep 9 2005 ash.static
lrwxrwxrwx 1 web22_xxxxxxx web22 4 Jul 6 2006 awk -> gawk
-rwxr-xr-x 1 root root 15168 Jan 31 2006 basename
-rwxr-xr-x 1 root root 490716 Sep 9 2005 bash
-rwxr-xr-x 1 root root 19220 Jan 31 2006 cat
-rwxr-xr-x 1 root root 37020 Jan 31 2006 chgrp
-rwxr-xr-x 1 root root 36044 Jan 31 2006 chmod
-rwxr-xr-x 1 root root 40284 Jan 31 2006 chown
-rwxr-xr-x 1 root root 5000 Sep 9 2005 chvt
-rwxr-xr-x 1 root root 61548 Jan 31 2006 cp
-rwxr-xr-x 1 root root 100480 Apr 27 2006 cpio
lrwxrwxrwx 1 web22_xxxxxxx web22 4 Jul 9 2006 csh -> tcsh
-rwxr-xr-x 1 root root 47368 Jan 31 2006 date
-rwxr-xr-x 1 root root 44748 Jan 31 2006 dd
-rwxr-xr-x 1 root root 5472 Sep 9 2005 deallocvt
-rwxr-xr-x 1 root root 38696 Jan 31 2006 df
-rwxr-xr-x 1 root root 5140 Sep 13 2005 dmesg
lrwxrwxrwx 1 web22_xxxxxxx web22 8 Jul 6 2006 dnsdomainname -> hostname


lrwxrwxrwx 1 web22_xxxxxx web22 4 Jul 6 2006 sh -> bash

using this command:

chown root:root /bin/*


As you can see that folders whit this symbol ->, (are them folders? ) don't change the permission to root...

Do you know why?

martinfst
16th February 2007, 13:28
-> indicate a symbolic link, a pointer to the actual file. To change the symbolic link owner/group add the -h flag:
chown -h root:root /bin/filenamePlease stop using the asterix '*'to address files. It will expand to every file in the /bin directory (in this example). Using the * constantly will bring you further and further away from solving this. Use the real and full path name. Example: /usr/bin/vi. Nothing less.

nox171
19th February 2007, 12:18
Thank you guys for your quick help!

After 2 full days of work my ISPconfig is again online!!

:D