Announcement

Collapse
No announcement yet.

Help did something very stupid

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help did something very stupid

    Hi,

    I was trying to change file ownership of some files, and accidentally wrote sudo chown joe:joegroup /*/* where joe and joegroup are my username and group. Now I can't do anything that requires sudo like changing the ownership back or running adept.

    When I try to use sudo on the command line i get sudo: /etc/sudoers is mode 0644, should be 0440
    joe@joe-desktop:/bin$ sendmail: fatal: open /etc/postfix/main.cf: No such file or directory

    When I try to run adept it displays an error tha says "Su returned with an error".

    I don't know what to do, any help will be appreciated.

    #2
    Re: Help did something very stupid

    boot in "recovery" mode (when you start your box, type "esc" to get to the boot menu).
    that should get you a root shell.
    cd into the directory you were when you issued the chown command.
    change the relevant ownership(s) back.
    then issue:
    Code:
    init 2
    all should be back alright.
    hth
    gnu/linux is not windoze

    Comment


      #3
      Re: Help did something very stupid

      Ouch.
      It doesn't matter where he was: he did "chown foo:bar /*/*"--meaning it chowned /*. That's... everything. Every last file.

      I guess you could "chown root:root /*", "chmod g+rw /*", and "chown you:you /home/[user]". That'll get everything pretty close to normal, except for things like sendmail, which have things owned root:mail so that they can write to them.

      The only way to completely fix everything would be to do a complete reinstall. You've almost hosed your box. Not quite, but pretty close.
      For external use only.

      Comment


        #4
        Re: Help did something very stupid

        Originally posted by SheeEttin
        It doesn't matter where he was: he did "chown foo:bar /*/*
        true

        Originally posted by SheeEttin
        "--meaning it chowned /*. That's... everything. Every last file.
        a lot.
        not everything.
        chown -r would be everything.


        gnu/linux is not windoze

        Comment


          #5
          Re: Help did something very stupid

          There is no -r. If you thought -r was recursive; no, -R (which he did) is recursive.
          For external use only.

          Comment


            #6
            Re: Help did something very stupid

            Originally posted by SheeEttin
            Ouch.
            It doesn't matter where he was: he did "chown foo:bar /*/*"--meaning it chowned /*. That's... everything. Every last file.

            I guess you could "chown root:root /*", "chmod g+rw /*", and "chown you:you /home/[user]". That'll get everything pretty close to normal, except for things like sendmail, which have things owned root:mail so that they can write to them.

            The only way to completely fix everything would be to do a complete reinstall. You've almost hosed your box. Not quite, but pretty close.
            that's what i tought but chown root:root /* does not work, because something happened to su and sudo. Getting ready for a complete reinstall.
            That should teach me not to mess with chown at 2:00 in the morning

            Comment


              #7
              Re: Help did something very stupid

              Originally posted by DAGA
              I was trying to change file ownership of some files, and accidentally wrote sudo chown joe:joegroup
              or didn't s/he?
              gnu/linux is not windoze

              Comment


                #8
                Re: Help did something very stupid

                Can I pose a not-altogether-tangential question about your motivation for doing what you did? In other words, why did you do it - and which files were you intending to change?

                Comment


                  #9
                  Re: Help did something very stupid

                  Originally posted by JamesM
                  Can I pose a not-altogether-tangential question about your motivation for doing what you did? In other words, why did you do it - and which files were you intending to change?
                  A friend brought his hard drive with some files I needed, I copied them to my home folder but after that all the files belonged to root and couldn't work with them. I thought that if I used and asterisk it would change all the files ownership quickly but accidentally put the slash before the asterisk and my troubles began.

                  Comment


                    #10
                    Re: Help did something very stupid

                    Yeah. Need to be pretty careful with sudo, the ch* commands, and globbing.
                    Nasty things like that happen.
                    For external use only.

                    Comment

                    Working...
                    X