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

    chmod / -R 777 - uh oh.

    Ok, new to linux. - Running newest version of debian, and in an attempt to fix permissions on files in a folder recursively I did

    chmod / -R 777

    instead of ofcourse,

    chmod . -R 777

    and now I'm getting errors for example like

    "/var/run/sshd must be owned by root and not group or world-writeable"

    so I worry now if I restart my system, if there will be other services that will fail.

    I stopped the chmod -R thingy as soon as I saw what I had done, so it shouldn't be all files, but enough to cause some problems.

    Is there anyway I can reset the permissions as they are set during install ?
    Or a script I can run somewhere ?

  2. #2
    Linux Guru Segfault's Avatar
    Join Date
    Jun 2008
    Never ever use your box as root. This simple truth is reiterated over and over and still people with "other OS" background tend to ignore this.
    Permissions in a *NIX systems are refined over decades to protect you and your system. Running as root you trash it all, nothing is denied to root, all processes initiated by root run with root rights which makes it extremely easy to compromise your box, by viruses or by yourself.

    You wanted to do chmod . -R 777.
    There is absolutely no need to run this command as root. You are supposed to do all your stuff in your home directory as user. All files in users home belong to user, meaning user rights are sufficient to run this command. If you make a mistake, as you did, system will not allow it. If you are absolutely sure you need to run something as root use sudo.

    I'm not aware of any script to fix it. Restoring from backup or reinstall are the only options. In case you used some intrusion detection software as Aide you may be able to restore permissions using its logs.

  3. #3
    Thanks, as I said, new to linux - have changed from running as root now.

    Wondering if this is something that I could find in the src. code for debian ? Some script must setup the initial permissions.

  4. $spacer_open
  5. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    I second Segfaults point of view.

    In theory and with a lot of effort you could set the permissions right by comparing with another installation.
    But itīs really not worth the time.
    Safe your data and config, then reinstall.
    You must always face the curtain with a bow.

  6. #5
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    No script for setting permissions.

    Permissions are described in the debian packages.
    But I guess re-installing each of them will also bork up due to the mess in your system right now.
    You must always face the curtain with a bow.

  7. #6
    Is there any way I can set the permissions quickly so the system will function correctly - even if those permissions are too broad to be considered safe ?

    Logic being that if all users have the permission to do anything - the system should startup - even if unsecure ?

  8. #7
    Actually, doing a new installation on a virtual computer, dumping the file system permission in a file and creating a script for that shouldn't be do difficult.

    But in your experience opinion will my system start if I restart the computer ?

  9. #8
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Some servers, especially ssh and security related ones will flat out refuse to start, if their files and directories are insecure.

    And as I said, theoretically you can take the effort and repair all permissions.
    But I would never go that road.
    Try it, if you must. But I guess you will find it a major pita.
    Backup of config + data and reinstall will be faster imho.
    You must always face the curtain with a bow.

  10. #9
    I have 1.5 tb of data on a raid, I had some trouble getting up, and as is it's the only one source of that data. I'll guess I'll back that up and do a reinstall.

    The raid should be ok to mount again, but had some problems with it during install so I'd prefer not to take that route again, although I know the steps now.

  11. #10
    When I say only one source of data, I mean I have the other data in other areas backed up - but even lan network copy times for that amount is huge.

Posting Permissions

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