One issue I have heard about, involves the /etc/ folder permissions being set to an “bad” value…
For example, if you set /etc/ to 755, Mac OS X will not allow a shell session (terminal) to be opened… Â It will report “The Administrator has set your shell to an illegal value“. Â If you try an sudo command, you will see an error (“sudo: can’t open /private/etc/sudoers: Permission denied sudo: no valid sudoers sources found, quitting“).
What’s the easiest way to resolve this?
If you are running 10.7, restart your system, and hold down the option key. Â This will bring up the boot device list, choose your recovery partition (“Recovery HD“). Â The “Mac OS X Utilities” menu will appear, highlight “Disk Utility“Â and hit Continue. Â From the Disk Utilities left side bar, choose your hard drive (e.g. “Macintosh HD”). Â In the “First Aid” pane, click on “Repair Disk Permissions”.
Repair Disk Permissions should repair the permissions issue, and allow you access to the Terminal / Shell sessions.