Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Resetting ownership

    I accidentally chowned my whole filesystem to nobody:nogroup.

    Stupid, I know.

    I'm wondering if apt keeps a copy of the perms it set during installs like RPM does?

    If not, is there any other way to restore the perms easily?

    If not, does anyone have a quick screenshot of their root level perms on Debian Hardy? I can at least start with a chown -R of the top level dirs and see how close that gets me.

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Harrow, UK
    drwxr-xr-x 2 root root 4096 Apr 26 17:56 bin
    drwxr-xr-x 2 root root 4096 Sep 27 2009 boot
    drwxr-xr-x 10 root root 3660 May 7 16:24 dev
    drwxr-xr-x 22 root root 4096 May 7 16:24 etc
    drwxr-xr-x 4 root root 4096 Sep 3 2009 home
    drwxr-xr-x 7 root root 4096 Apr 26 17:55 lib
    drwx------ 2 root root 16384 Jun 29 2009 lost+found
    drwxr-xr-x 6 root root 4096 Jun 29 2009 media
    drwxr-xr-x 3 root root 4096 Sep 3 2009 mnt
    drwxr-xr-x 10 root root 4096 Oct 4 2009 opt
    dr-xr-xr-x 69 root root 0 May 7 16:24 proc
    drwxr-x--- 6 root root 4096 Apr 12 11:12 root
    drwxr-xr-x 2 root root 4096 Apr 26 17:56 sbin
    drwxr-xr-x 12 root root 0 May 7 16:24 sys
    drwxrwxrwt 5 root root 120 May 7 17:36 tmp
    drwxr-xr-x 11 root root 4096 Apr 26 18:04 usr
    drwxr-xr-x 12 root root 4096 Apr 19 22:12 var
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  3. #3
    How did you manage to do that? It came to my mind that perhaps chown should be interactive when this sort of thing is attempted recursively on any major directory.

  4. $spacer_open
  5. #4
    I accidentally chowned my whole filesystem to nobody:nogroup.
    I can promise you that you're not the only one to do this sort of thing.
    When I did something similar I lost patience with re-chowning and re-chmod-ing and just re-installed, which is probably the best thing to do. (EDIT) though it would be simpler if only the ownerships are wrong.
    On Mac OS/X, where permissions get screwed with monotonous regularity, there is a tool for re-setting the permissions to their default values. I've read that
    rpm -a --setperms
    works on rpm-based systems. Haven't found anything for Debian and friends.
    It strikes me that a script to reset permissions would be a useful addition to the Linux toolbox - I suppose it would have to have options to cover a number of different distros.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts