[10.4.10] How do I regain root/admin access?

Discussion in 'Apple' started by Eric P. Peterson, Jul 4, 2007.

  1. Hello,

    In attempting to change the short username for the root user account on
    my G4 Quicksilver, I logged in as a different user with admin
    privileges, copied the contents of the root user Home folder to Shared,
    then deleted the root user and gave a new account (again with admin
    privileges) the short name I wanted. Then I attempted to copy the
    contents of the Shared folder to the new account's User folder, but
    Desktop and Library folders are inaccessible (I don't have enough
    privileges, the system tells me).

    Yes, I've done a Very Bad Thing here, but there must be a fix for it,
    right? I'm not afraid to use the Terminal, but a GUI-based solution is
    preferable :) I read somewhere that I could find what's been deleted in
    /Users/Deleted Users, but I find no such directory.

    I'm the only user of this computer, and I don't have any install discs,
    because I bought the system used without the install media (like a
    chump). I'd greatly appreciate some helpful advice as to a solution
    here, because constantly having to authorize for installs and folder
    access is taking a growing toll on my productivity with the system.

    TIA and happy computing,
    Eric
     
    Eric P. Peterson, Jul 4, 2007
    #1
    1. Advertisements

  2. Try and get to be root in reality

    If you can open up a terminal and do

    sudo passwd root

    and set a root password, then you can

    su -

    enter the password, and become root and fix (or break) anything.
     
    The Natural Philosopher, Jul 4, 2007
    #2
    1. Advertisements

  3. Yes...so, if a root account currently exists on this system, I'm unable
    to access it. If I've destroyed it, I'll have to wait till I can obtain
    the discs at a price I can afford (I keep searching, but haven't found
    any for sale yet on-line), then give up and reinstall the OS.

    Thanks,
    Eric
     
    Eric P. Peterson, Jul 4, 2007
    #3
  4. Have you tried sudo passwd root?
     
    The Natural Philosopher, Jul 5, 2007
    #4
  5. Indeed, I'm aware of the issue with different discs being for different
    models, so I always ask specifically a) what the labels look like, and
    2) if they're for the G4 Quicksilver. If I'm really lucky, the same
    discs will work in both the QS and the Sawtooth, but I wouldn't bet on
    it ;) I also know that I should look for only the full retail version.

    Thanks!
    Eric
     
    Eric P. Peterson, Jul 5, 2007
    #5
  6. I did that today. It appears to have given me access to folders that
    were being stubborn before. I vaguely recall a Terminal command to type
    for logging in as root, but I don't recall exactly what it is, and "man
    rlogin" isn't helping me, because my familiarity with UNIX is limited.

    Currently, I see nothing in the Shared folder, when I was expecting to
    see a couple folders there. Looking in the other account on my system,
    "spareuser," that I created to be able to use in case something goes
    wrong (and why am I now laughing at myself?), all the usual folders are
    present there, and the Documents, Movies, Music, and Pictures folders
    have the little red symbol on them. Library has several items inside
    that also have this symbol. All other folders on the boot volume are
    fully accessible.

    I think I'm still going to be somewhat disabled till I can purchase the
    install discs, so I'll have to bear with things as they are for now.

    Thanks,
    Eric
     
    Eric P. Peterson, Jul 5, 2007
    #6
  7. A note about that: typing ls -l in the Terminal reveals the following:

    total 8
    -rw-r--r-- 1 ericp ericp 498 Jul 3 11:33 Data Rescue II Report.txt
    drwx------ 4 ericp ericp 136 Jul 3 23:51 Desktop
    drwxr-xr-x 12 501 wheel 408 Jul 3 15:43 Documents
    drwxrwxr-x 2 501 admin 68 May 6 2005 Faxes
    drwxr-xr-x 4 501 wheel 136 Jun 28 23:35 FontExplorer X
    drwx------ 36 ericp ericp 1224 Jul 4 12:27 Library
    drwxr-xr-x 3 501 wheel 102 Jun 26 05:21 Movies
    drwxr-xr-x 5 501 wheel 170 Jul 1 08:17 Music
    drwxr-xr-x 4 501 wheel 136 Jun 27 16:22 Pictures
    drwxr-xr-x 4 ericp ericp 136 Jul 3 06:17 Public
    drwxr-xr-x 5 ericp ericp 170 Jul 3 06:17 Sites

    I don't know if anything useful can be gained by this information. I
    don't know what "wheel" and "501" are all about, for example.

    Thanks,
    Eric
     
    Eric P. Peterson, Jul 5, 2007
    #7
  8. Eric P. Peterson

    Hans Aberg Guest

    If this is the account at /var/root/ with user name "root", don't change it.
    This can be changed using 'chpass', see the man-page. You can even change
    user and directory names independently.

    The setup I find most convenient: Install the Fink emacs-21.2 which
    supports X11; put into the file .profile:
      export DISPLAY=:0.0
      export EDITOR=emacs
    Then start X11 and type say in Terminal (from an admin account):
      sudo -s
      chpass <username>
    where <username> is the user name. Edit data in Emacs, save, and quit it
    (the new data will be read and installed at quit). You may have to log out
    to see the changes taking effect (don't remember). And the OS might
    possibly become confused by this method, if you try to reuse old user
    names. :)

    Hans Aberg
     
    Hans Aberg, Jul 5, 2007
    #8
  9. I am not sure that the root account HAS been deleted. Not all of it anyway.

    As long as it exists in /etc/passwd..

    If it was deleted, I am not sure the machine would in any way work.
     
    The Natural Philosopher, Jul 5, 2007
    #9
  10. 501 is the user id of the account that has gone.

    Its not root tho.
    wheel is a group id.
     
    The Natural Philosopher, Jul 5, 2007
    #10
  11. Do a su - root then, and become root.

    You should be able to repair anything permissions wise.

    You haven't deleted root, just the user who had root permissions.

    That IS restorable in every sense, tho it may be a longish haul.
     
    The Natural Philosopher, Jul 5, 2007
    #11
  12. Thanks, Hans. I'll look into this.

    - E
     
    Eric P. Peterson, Jul 5, 2007
    #12
  13. In that case, perhaps I didn't lose anything critical...

    Thanks,
    Eric
     
    Eric P. Peterson, Jul 5, 2007
    #13
  14. Aha! I see how that works...just did it now :)
    Is there a way in the Terminal that I can locate and restore what has
    been "lost"?
    Very reassuring :) I need to learn enough NOT to be dangerous in the
    Terminal, but rather to be responsible with the power that root access
    brings ;)
    That's fine. I'm used to doing things the long, convoluted way, and then
    finding more efficient ways to do the same things later. Not ideal, but
    that's my reality, anyway :)

    Thanks,
    Eric
     
    Eric P. Peterson, Jul 5, 2007
    #14
  15. Not too critical: However on probing the wifes G4 MAC it appears that
    the whole user/password thingy now is handled by netinfo..so I am not
    too clear as to how you can manually tweak things to restore a user you
    have deleted.

    What exactly did you do, again?
    I've lost the original post.

    Oh. I found some stuff on the apple site. The bastards have stopped Unix
    hackers getting under the hood.. you should read thus

    http://docs.info.apple.com/article.html?artnum=60025

    and probably recreate a user with the *same name AND UID 501* as the
    one you deleted..


    I can't piss about with my wifes machine to test this, so go carefully.

    Thats SHOULD get the user back and running.

    If you don't have admin rights to run that screen I am not sure what
    comes next.
     
    The Natural Philosopher, Jul 5, 2007
    #15
  16. Eric..

    What did you actually DO.

    Tye fact that you can su from a terminal suggests that you DO have admin
    rights..
     
    The Natural Philosopher, Jul 5, 2007
    #16
  17. In that case, perhaps I didn't lose anything critical...[/QUOTE]

    On Mac OS X, user ID values for 'real' user accounts start at 501, so
    the account you deleted was the almost certainly the first account
    created after OS X was installed.

    So you deleted an *admin* account, not the root user.

    You said you have another account with admin privileges, so you haven't
    done any damage, and you don't need any install media to fix it. All
    you have to do is change the owner of those files & folders, which you
    can do in the Finder through the Get Info command. Do you need
    instructions for that?
     
    Wayne C. Morris, Jul 6, 2007
    #17
  18. On Mac OS X, user ID values for 'real' user accounts start at 501, so
    the account you deleted was the almost certainly the first account
    created after OS X was installed.

    So you deleted an *admin* account, not the root user.

    You said you have another account with admin privileges, so you haven't
    done any damage, and you don't need any install media to fix it. All
    you have to do is change the owner of those files & folders, which you
    can do in the Finder through the Get Info command. Do you need
    instructions for that?[/QUOTE]

    I believe I've found that, under Ownership & Permissions in a folder or
    file's Get Info window. I can change the owner to any user. This often
    requires me to authenticate, then the change takes effect. Tedious, but
    effective.

    Thanks,
    Eric
     
    Eric P. Peterson, Jul 8, 2007
    #18
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.