Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Please, i am using Ubuntu 11.10 and I made a mistake in system directories, changed permissions of all content to 777. I was trying to correct some files, but i cant fix all directories and files. Can I return to default permissions??

Thanks.

share|improve this question

closed as too localized by Javier Rivera, mikewhatever, Ringtail, fossfreedom Mar 31 '12 at 22:24

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
possible duplicate of How do you fix file permissions for root directory? –  Javier Rivera Mar 27 '12 at 13:52
    
cant fix from first command: chown: can not get the target referenced by "/ etc / blkid.tab": File or directory not found --->> Sorry, not working! –  Daniel Accorsi Mar 27 '12 at 14:30
    
Which command didn't work? you should be able to use chown –  Christian Vielma Mar 27 '12 at 15:41
    
i am trying: sudo chown root.root /etc/* –  Daniel Accorsi Mar 27 '12 at 15:43

2 Answers 2

up vote 3 down vote accepted
We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

fdisk, format, reinstall, doo dah, doo dah. i.e.

root@loki:~# find /etc/ -type f -exec ls -al {} \; | awk '{print $1}' | sort | uniq
-r--r-----
-rw-------
-rw-r-----
-rw-r--r--
-rw-rw-r--
-rwxr-xr-x
root@loki:~# find /etc/ -type d -exec ls -al {} \; | awk '{print $1}' | sort | uniq
drwx------
drwxr-s---
drwxr-xr-x
drwx--x---
lrwxrwxrwx
-r--r-----
-rw-------
-rw-r-----
-rw-r--r--
-rw-rw-r--
-rwxr-xr-x

some blanket chmod'ing and chowning in /etc is not going to fix this. you've made a proper mess of things, and a reinstall is the quickest and cleanest way to fix it RIGHT. any thing else, short of restoring content or images from backups is both a waste of time and incomplete.

chalk it up to experience (i've certainly hosed many an install learning), and move forward.

share|improve this answer
    
Yes... i have some differences on my permissions... I will reinstall. Thanks. –  Daniel Accorsi Mar 28 '12 at 18:09

Let's do this from the terminal

1) sudo -i

2) sudo chown root.root /etc/*

3) sudo chmod 755 /etc/*

4) exit

In case you need to reset the permissions on sudoers, the permissions should be set to:

1) chmod 440 /etc/sudoers

It is owned by root.root

I think most file system have permission of 755 for folders and 644 for files except for /bin which has executable files with root as owner.Hope this helps...

ref

share|improve this answer
    
Hi, thanks. Same I mentioned above when i using the second command: "chown: can not get the target referenced by "/ etc / blkid.tab": File or directory not found". –  Daniel Accorsi Mar 27 '12 at 17:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.