Philipps Blog

2009/01/11

what to do, if you locked yourself out from Mac OS?

Filed under: Mac,Personal,Snippets,Tech — philipp @ 1:32 pm

Yesterday I found myself in a strange situation:

Every Shell Command I tried to use ended up with a “command not found“. This happened with sudo, nano … you name it.

After a short time, I figured out that the folder /usr/bin (where all these programs are stored) had only executable rights for the owner (so admin:wheel).

As a normal user I was not able to use them.

So how to change this if you cannot sudo ?

As always in MacOS, the best way to fix this, is to boot into Singe User Mode (restart and press the Apple/Command Key + “S”).
After you got into the Terminal view you have to scan the filesystem for errors:

/sbin/fsck -fy 

And then remount it as writable:

/sbin/mount -wu /

Now, you can alter the user rights for /usr/bin with:

chmod 755 /usr/bin

After a reboot you are again able to execute the commands.
If you still have problems you should control your PATH-settings.

echo $PATH 

It should contain /usr/bin near the beginning.

3 Comments »

  1. Wie kam es dazu?

    Comment by Christoph — 2009/01/25 @ 12:33 am

  2. Hi,
    wie ist es dazu gekommen?

    Gruß,
    Christoph

    Comment by Christoph — 2009/01/25 @ 1:14 am

  3. durch ein Update von mysql und/oder jRuby + gems und Ruby + gems…

    Und durch eine zu späte Uhrzeit :-D

    Comment by Philipp — 2009/02/16 @ 1:11 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress