Mac OS X - Could not start Terminal.app - shell has illegal value

16

2

I can not run the Terminal.app after rolling back my system from time machine.

Mac OS X Version 10.6.2

It displays the following error. "Your are not authorized to run this application" "The administrator has set your shell to an illegal value"

After that I have deleted the file ~/Library/Preferences/com.apple.Terminal.plist

But the same message is displayed.

I have repaired all system rights with the DiskUtility but that did not help.

chemm

Posted 2009-11-13T12:40:22.877

Reputation: 261

Answers

10

Rebooting is the answer in OS X Lion. If you lose the ability to write to USB or network drives, the solution is the same.

I'm hoping for some swift updates to get rid of some of these annoying problems.

Rune Smistad

Posted 2009-11-13T12:40:22.877

Reputation: 101

10

This value is set to /bin/bash. Nothing to change here. I have controlled these preferences. I get this error for every shell.

Finally I found the solution. In Finder I go to open folder /etc. There I found the file /private/etc/shells, which was empty. I replaced the file /private/etc/shells with the backup file /private/etc/shells~orig.

Now the /private/etc/shells contains the following:

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

(There are more steps needed in Finder, delete empty shells file, change permissions in the information dialog.)

Now I can start the Terminal.app with the /bin/bash again.

chemm

Posted 2009-11-13T12:40:22.877

Reputation: 261

I found that my account wasn't even able to see the /etc /bin folders for some reason though I can see them from a local admin account also on the machine (my main account is a corporate domain account). Thought about using CHMOD from the admin account to change access to the /etc /bin directories. – ScottCher – 2011-05-10T21:27:13.657

Consider accepting your (or another) answer to this question. – Daniel Beck – 2011-05-14T03:35:31.830

5

I had the same problem after a Time Machine restore, in this case, using the backup from a MacBook Pro to restore to a MacBook.

I was able to solve the problem just using Finder (enter your password each time requested):

  • Use Go > Go to Folder to go to "/private"
  • Select "etc"
  • Command-I to bring up the Information pop-up (don't close it again till the end of this procedure)
  • Click the lock symbol in lower right corner to unlock permissions
  • Make a note of the permission setting for "Everyone"
  • Click the permission setting for "Everyone" and select "Read & Write"
  • Use Go > Go to Folder to go to "/private/etc"
  • I found that "shells" was empty, but there was a "shells~orig" with a good list of shells in it
  • Delete "shells"
  • Select "shells~orig"
  • Command-C, Command-V to copy-and-paste it; this creates "shells~orig copy"
  • Select "shells~orig copy
  • Click again to enter rename mode and change name of "shells~orig copy" to "shells"
  • Return to the Information pop-up and change the permission setting for "Everyone" back to its original value
  • Close the Information pop-up

Now that I had a "shells" file with a valid list of shells, I was able to open Terminal again.

Lindsay

Posted 2009-11-13T12:40:22.877

Reputation: 51

4

I had the same problem; a reboot did the trick for me. Not used to having to do that on a Mac :-P

atraudes

Posted 2009-11-13T12:40:22.877

Reputation: 161

Same with me (on Lion). Other apps were acting up (like BBEdit) so I figured I'd try a restart first and it worked. – nevan king – 2011-09-06T10:57:36.467

4

Right-click your account name in System Preferences' Accounts pane and choose Advanced Options. Change the value for "Login shell" - I use /bin/bash, but you're free to use any installed shell.

Tim

Posted 2009-11-13T12:40:22.877

Reputation: 522

3

I had the exact same problem too. Simple solution:

Just run Repair Disk Permission with Disk Utility :-).

hobbes3

Posted 2009-11-13T12:40:22.877

Reputation: 741

3

Changing my user account password via System Preferences fixed this for me(I changed it to the same value, which presumably just forced the OS to write some user account info to files). I use Mac OS X 10.7.3 and no files in /etc seem to have been changed.

Adam Nohejl

Posted 2009-11-13T12:40:22.877

Reputation: 31

2

I had the same problem. Time Machine for some reason turned /private/etc/shells into a zero length file during my restore. chemm's answer is pretty good, but misses some steps for Mac noobies like me.

  • To even get to /private/etc you need to use the Finder menu item Go -> Go to Folder option and type /private/etc
  • Then locate the shells file.
  • It would not allow me to edit the file at all, so I deleted it.
  • Then I used time machine to restore that file.
  • If you enter the time machine while in Finder it'll start you off in that /private/etc folder.
  • When I restored it, I could not figure out how to direct Time Machine to that folder (didn't see a go to folder option), so I restored "shells" to my desktop and then used Finder to copy/paste the file to /private/etc

You'll need to supply your password a few times to achieve the above, and I suppose you'll need to be on an administrator account.

user33466

Posted 2009-11-13T12:40:22.877

Reputation: 21

2

Combining answers from Tim and chemm was useful in my case.

I used Tim's approach to bring up a terminal using a different shell. I then edited /etc/shells to include the preferred shell and then used Tim's approach again to restore the original shell path in the "Advanced Options".

Frank

Posted 2009-11-13T12:40:22.877

Reputation: 21

0

For me, none of the standard answers was the issue - everything was as-it-shoud-be.

Quitting my Aquamacs (emacs) session fixed the problem ! When I restarted Aquamacs, Terminal continued to work fine.

I had NOT used the emacs shell command, but somehow these applications still interacted in an unfortunate way.

Howard Nebeck

Posted 2009-11-13T12:40:22.877

Reputation: 1