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

Solution 1:

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.

Solution 2:

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.

Solution 3:

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.

Solution 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.