0

I get the file parmission on my folder, so I run the following command

sudo chmod 777 -R /*

and get some error line. then I try to login as root user by the following command

sudo su

get this error like as

supravat@supravat:~$ sudo su
sudo: must be setuid root

Then I research regarding this error. and followed some source but error is still present. http://www.linuxquestions.org/questions/linux-software-2/sudo-must-be-setuid-root-854117/

When I run following commend as like

chown root:root /usr/bin/sudo

Get this mesasage..

chown: changing ownership of '/usr/bin/sudo' : read-only file system

Please help me.

Supravat Mondal
  • 185
  • 2
  • 3
  • 13

3 Answers3

4

The command you run: sudo chmod 777 -R /* or sudo chmod 777 -R / changes the permission of ALL file in your system to 777: read, write and executable for everyone. That's a major security risk. You opened your system for everyone. NEVER run this command. Everyone who gives you that command wants your system to be insecure. It's peanuts to get root access on such a system.

I recommend you to reinstall your whole system. You could try to set the permissions back to the original ones, but you can never be sure. I see only one option: Reinstallation.

chaos
  • 27,506
  • 12
  • 74
  • 77
1

sudo checks that its permissions are 4755 (rwsr-xr-x). After giving world-writable permissions to every file as you have, the entire concept of becoming superuser to do privileged work is defeated, as anyone and everyone who logs on your system can do everything and anything superuser can.

After a

sudo chmod 777 -R /*

only a full reformat and reinstall makes the box safe again. I really don't know of a list of system files with default out-of-the-box permissions.

Even if you find this, you also need a list of system file checksums, and to verify the checksum program itself to ensure your method of ensuring the authenticity of files wasn't compromised.

Probably it is simpler to reformat the drive and reinstall Linux.

Hope this helps.

gmt42
  • 381
0

your this command is the most bad approach i have ever made

sudo chmod 777 -R /*

actually you have give all red,write and execution permission. never do such work i think u should learn, study and understand Linux solve of your problem is

chmod 4755 /usr/bin/sudo

then run

chown root:root /usr/bin/sudo

and after this you will find some other file having same problem so better you check all the file permission from a well running system and apply them to your filesystem.

smn_onrocks
  • 526
  • 5
  • 14