Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Complete list of default file permissions

  1. #1
    Join Date
    Apr 2011
    Beans
    12

    Exclamation Complete list of default file permissions

    Fellow Ubuntu Server users,


    While I've used linux for years, I still consider myself a novice in many areas...and occasionally make fatal mistakes like running retarded commands like `sudo chmod -R 664 *` which have screwed my installation royally and made me reformat and start over from scratch...leading to hours and hours wasted.


    What I want to know is whether there is a website or any type of resource that shows what the default permissions of each file should be on a vanilla installation of Ubuntu Server. Most importantly (in my case), the /etc directory, but knowing the rest of them wouldn't hurt either. I ran a `sudo chmod .*` in the /etc/skel directory...which went up to the /etc/ directory and changed every file in that directory (but not subdirectories luckily cause no -R). Sooo....I managed to change sudoers back and get into root, but am afraid to restart as I don't know what else in the /etc will bomb based on invalid permissions.


    Any help would be most appreciated!

  2. #2
    Join Date
    Oct 2011
    Location
    Mauritius
    Beans
    56
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Complete list of default file permissions

    Quote Originally Posted by lorewap3 View Post
    Fellow Ubuntu Server users,


    While I've used linux for years, I still consider myself a novice in many areas...and occasionally make fatal mistakes like running retarded commands like `sudo chmod -R 664 *` which have screwed my installation royally and made me reformat and start over from scratch...leading to hours and hours wasted.


    What I want to know is whether there is a website or any type of resource that shows what the default permissions of each file should be on a vanilla installation of Ubuntu Server. Most importantly (in my case), the /etc directory, but knowing the rest of them wouldn't hurt either. I ran a `sudo chmod .*` in the /etc/skel directory...which went up to the /etc/ directory and changed every file in that directory (but not subdirectories luckily cause no -R). Sooo....I managed to change sudoers back and get into root, but am afraid to restart as I don't know what else in the /etc will bomb based on invalid permissions.


    Any help would be most appreciated!
    I'm not sure what you're looking for but maybe it's
    Code:
    ls -l

  3. #3
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,699

    Re: Complete list of default file permissions

    As far as I know, that information is stored in the .deb packages. To know the proper settings would require examining every paclage in the repositories. Worse, I think some files are created by scripts, so even examining the archives of every .deb in the repo won't tell you everything. If you're in the habit of mucking up the permissions, then keeping good backups is probably the best solution.

  4. #4
    Join Date
    Apr 2011
    Beans
    12

    Re: Complete list of default file permissions

    I hope the first post was ironic, but even if it wasn't, I deserved it for the mistake.

    I was just hoping there would be some place on the net that had listed the directory structure and permissions of just a standard Linux install. They're all pretty much the same before you start adding globs of packages, and even then messing up permissions on those would only affect the package, not the kernel or core OS.


    Ex. I know that /etc/sudoers REQUIRES 440 or it doesn't work at all. There are a few similar rules but I have no clue how to find out what they would be. That one will pretty much shut you down for good unless you've already enabled the root account which most distributions don't recommend or sometimes even allow. Even with a root account enabled, without some guide to the default permissions you have to sit there and just keep troubleshooting every part of the OS until it works. Most of the time it's just easier to re-install the entire thing, which is neither educational nor time efficient.

    A simple webpage with a recursive 'ls -l' on a default installation would at least tell you what the permissions start as in Ubuntu's eyes.

    As I said I'm slowly learning more and more about each package and its own quirks but it's a slow process and I'm certainly never going to have the permissions mysql requires on its db files memorized a year from now. Months ago I moved the mysql db files to a different location and it took unnecessary hours figuring out the perfect owernship/groups/permissions it wanted to work properly. Man pages almost never touch on this.

  5. #5
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Complete list of default file permissions

    Boot the live CD and run a script that puts the permissions of all the files into a database =)
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  6. #6
    Join Date
    Apr 2011
    Beans
    12

    Re: Complete list of default file permissions

    Yeah...I know...stop passing the monkey. If thought I could do it in a few hours I would but definitely not that good. Maybe a few days probably more like a few weeks good, but I'm ok now so I apologize for my selfishness but I probably won't do it now. Next priority is getting connectivity to my storage on my server yet discover the perfect balance of permissions to prevent a potential attack if one goes awol or like me doesn't know what he/she is doing. Alas..

  7. #7
    Join Date
    Sep 2011
    Location
    London
    Beans
    384

    Re: Complete list of default file permissions

    Quote Originally Posted by lorewap3 View Post
    Yeah...I know...stop passing the monkey. If thought I could do it in a few hours I would but definitely not that good. Maybe a few days probably more like a few weeks good, but I'm ok now so I apologize for my selfishness but I probably won't do it now. Next priority is getting connectivity to my storage on my server yet discover the perfect balance of permissions to prevent a potential attack if one goes awol or like me doesn't know what he/she is doing. Alas..
    Hi Lorewrap

    Well we've all done it, hopefully only once. Don't forget chmod -R ugo+X is your friend for fixing the directories.

    Attached is the compressed output of
    Code:
    sudo find / -ls
    It was done on a 32-bit Ubuntu 10.04 system booted cleanly at Amazon from Canonical's image ami-311f2b45.

    Is that what you needed?

    Kind regards,
    Jonathan.
    Attached Files Attached Files

  8. #8
    Join Date
    Apr 2011
    Beans
    12

    Re: Complete list of default file permissions

    Thanks Jonathan,

    I really appreciate this. I had fixed the problem (only by luck) so I kinda dropped the subject, but I'm glad I'll have this for the next time I do something stupid like this.

    In the end I knew I only changed the /etc directory and no sub-directories, so I just did 755 on the directories and 664 on most of the files, except for sudoers and a few others. It seemed to work fine. The only way I didn't have to start over is I was lucky enough to have a console in one of my 'screen's that had 'sudo -i' to root. Had I not done that before my mistake I would have had to boot into safe mode, etc... doable...,but definitely not remotely which is how I use this thing 99% of the time.

    Thanks for your time in doing this for me man, not many people would have.

    Will

  9. #9
    Join Date
    Sep 2009
    Location
    California U.S.A.
    Beans
    398

    Re: Complete list of default file permissions

    Wouldn't reinstalling your applications change the file permissions back (As in creating a list of installed apps and reinstalling from that list)? I don't know. I am just curious.

  10. #10
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Complete list of default file permissions

    Quote Originally Posted by dodo3773 View Post
    Wouldn't reinstalling your applications change the file permissions back (As in creating a list of installed apps and reinstalling from that list)? I don't know. I am just curious.
    In theory, yes. I have not tested this at all.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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