Chmod 000 in "/" partition. Urgent help to restore correct chmod

Issues related to applications and software problems
Post Reply
suportehostz
Posts: 2
Joined: 2012/08/06 13:42:30

Chmod 000 in "/" partition. Urgent help to restore correct chmod

Post by suportehostz » 2012/08/06 13:45:53

Hi,

I have a big problem

1. I have found an phishing script and try to chmod 000 him, but it is an symbolic link for "/"

Then, I do it:

chmod 000 sym/* -R

but in sym/ directory have an symbolik link for /

then when I do chmod 000 sym/* -R, it chmod 000 the "/"

then I press CONTROL ^C but it delay around 5 seconds.

Can you restore permissions or help ?

ty vm

the symbolic link is in
drwxr-xr-x 2 grecah grecah 4.0K Jul 17 05:26 sym/


NOW, NOTHING ARE WORKING cause chmod 000 like, sshd, ls, find, chmod, chown...


Please, CENTOS.OR can help with some script to restore chmod default in files? (Remember, it only around 5 seconds)

ty vm for all help

suportehostz
Posts: 2
Joined: 2012/08/06 13:42:30

Re: Chmod 000 in "/" partition. Urgent help to restore correct chmod

Post by suportehostz » 2012/08/06 14:51:14

I can use wget and yum and i in shell

DouglasRyder
Posts: 62
Joined: 2012/08/02 13:53:01
Location: UK

Re: Chmod 000 in "/" partition. Urgent help to restore correct chmod

Post by DouglasRyder » 2012/08/06 15:09:46

I think you are saying that you ran chmod -R 000 on the root partition, and that you left the command running for 5 seconds before hitting CTRL+C. If that's correct, then you are in trouble.

I don't think there is an easy way to reset all of the permissions to the correct values. Maybe somebody else can suggest one.

If you still have permission to run /bin/chmod, then you can repair some the damage. Try running:

>yum reinstall filesystem
>yum reinstall coreutils

This should reset the permissions on most of the directory structure, and on some of the core files in /bin & /usr/bin (including /bin/chmod).

You will probably need to take the system offline and reinstall it. If you need to copy data off the system before rebuilding, you can boot into rescue mode from the CentOS DVD.

Gleylancer
Posts: 34
Joined: 2012/08/02 14:53:55
Location: Hannover, Germany
Contact:

Re: Chmod 000 in "/" partition. Urgent help to restore correct chmod

Post by Gleylancer » 2012/08/06 15:09:47

As long as you are the owner of a directory or file, you should be able to chmod it to anything you like, even if the permissions are 000 right now. Of course you will have to do this manually for each file or use the above method to restore the core installation.

User avatar
TrevorH
Forum Moderator
Posts: 29159
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Chmod 000 in "/" partition. Urgent help to restore correct chmod

Post by TrevorH » 2012/08/06 20:19:14

Perhaps some variant on

[code]
rpm --setperms --setugids \*
[/code]

Be aware that anything like this stands a chance of making things worse so you should probably rescue as much data as you can before you really louse it up :-)

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Chmod 000 in "/" partition. Urgent help to restore correct c

Post by pschaff » 2012/08/06 20:23:28

You could try booting from the 6.3 installation DVD in rescue mode, then cd to the Packages directory, and run "rpm --setperms --root=/mnt/sysimage " on critical packages such as filesystem-2.4.30-3.el6.i686.rpm, bash-4.1.2-9.el6_2.i686.rpm, binutils-2.20.51.0.2-5.34.el6.i686.rpm, coreutils-8.4-19.el6.i686.rpm, etc., etc.

Post Reply

Return to “CentOS 6 - Software Support”