Fix permissions on the linux root

Asked

Viewed 3,825 times

-1

I made a mistake here on my linux, I ran it:

sudo chown -Rf www-data.www-data /*

And I gave one ctrl+c after four seconds... because I saw the mistake I had made.

That’s supposed to be it:

sudo chown -Rf www-data.www-data ./*

And now you’re making a mistake in sudo su, how to fix it?

 /etc/sudoers tem como dono o uid 33, deveria ser 0
  • 1

    in which directory you were running this command? if Voce ran this command at the root I think it is best to reinstall the system

  • 1

    no matter what directory it ran, by putting only the bar automatically the command was executed at the root

  • I’m gonna have to reinstall, but thanks for your help...

1 answer

2

You can sign in as super user with the command su, unlike the sudo, the su authentication as super user (super user password required, not user password).

Or sign in direct as super user. "Start terminal mode and Store as root".

After one of these steps, run the command:

$ chown -Rf root:root /bin/ /usr/ /dev /boot /etc /lib* /mnt /opt /proc /root /sys

The briefcase home is not among them not to give problems with the user.

This will restore the permission of most files, in the folder var, some folders have different users and groups of root, if restoring the directory /var take care of that.

Logging directly as super user by terminal mode is most recommended.

  • I tried this but it didn’t work, unfortunately. Even passing the owners to these directories I haven’t been able to log in the system...

  • What is your distribution? Remember the root password? (As you use sudo, you may only use the user password and don’t remember the root password).

  • It is Ubuntu linux 14.04 LTS, remember the password yes, even I have already entered in recovery mode, as root and typed there "passwrd Ivan" and also "passwrd root", I reset the passwords, and still, not enter... my user was "/home/Ivan", until I tried to play my user to be the owner, chown ivan:ivan -Rf /home/ivan and nothing...

  • I can only get into the "guest screen".

  • tried to type that command in recovery mode? try using a live cd

  • I managed to solve, installed the Ubuntu again, the problem is that as said a colleague, there are "n" files with "n" permissions, and each one has a permission for a certain process, for you to fix everything, you would take days, to search and know what each file of the system does, and who has the permits, you might even get it, but you’d have to devote yourself for a long time. So the best thing to do is to format. In short: I wouldn’t be able to.

  • But thanks for the reply.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.