I have a weird situation. I’m using Mac OS X 10.11 (El Capitan) and iTerm2.

Zsh is listed by default in /etc/shells as /bin/zsh, and this allows me to use Zsh without any issues on my standard account.

However, when I brew install Zsh and then use chsh or System Preferences -> User Groups -> etc, I get a login: /usr/local/bin/zsh: Permission denied error. This is after adding /usr/local/bin/zsh to /etc/shells.

I have run into the same problem with Fish, which is actually the shell I would prefer to be using. Now, I can use the shell without any issues when I su to an account with administrator access, but I can’t use these shells on my standard account.

As I mentioned earlier, the paths are added to /etc/shells and I have set the permissions to 755, but I still am having no luck.

Am I doing something wrong here? Or must I simply use an admin account in order to take advantage of these shells?

This is really disappointing, because I appreciate the heightened security of working in a standard account, but it sucks not being able to get the best shells outside of my admin account.


I want to emphasize that I am able to get Zsh working on my standard account only when using the path that is set by default, which is /bin/zsh in /etc/shells. This makes me question if there is some issue with the path being in /usr/local/bin/zsh.

However, this is the default, so I am wondering if there are others who are using a standard account with fish or a brewed zsh with success.

I have found little to no documentation on this.

  • Have you looked at the answers here? Seems like using chsh -s $(which zsh) as a standard user should allow you to change your shell. – JakeGould Oct 10 '15 at 2:25
  • I am looking to run fish/zsh as my default shell – badfilms Oct 10 '15 at 6:20
  • Also, from what I understand, the syntax that you suggested is no longer valid in OS X. It is the native Linux command. The OS X command is now chsh -s $SHELL – badfilms Oct 10 '15 at 6:26
  • Baffled by the idea chsh -s $(which zsh). I just tried it in Mac OS X 10.9.5—just using the Bash variant of chsh -s $(which bash)—and it works fine. All $SHELL is is the value of your current shell. So chsh -s $SHELL just would set your current shell to the changed shell which would result in chsh: no changes made. – JakeGould Oct 10 '15 at 6:47
  • I just included $SHELL as a stand-in for a generic shell. When I use the command in El Capitan, it gives me a usage error – badfilms Oct 10 '15 at 7:00
up vote 0 down vote accepted
+100

Is your Homebrew set up for multiple users? If not, take a look at this simple explanation: http://blog.strug.de/2012/06/my-homebrew-multi-user-setup/.

If it is, then make sure brew doctor shows good for each user you intend to give access to brew.


If you don't want it set up for multiple users, and you only want zsh and fish to work for multiple users, then you'll have to do some manual permissions fiddling.

Homebrew doesn't install to /usr/local. "Homebrew installs packages to their own directory and then symlinks their files into /usr/local." So 755 perms on /usr/local/bin/fish are useless. In fact, the simlinks should be set to 777.

You'll need to follow the links and set 755 on the actual executables instead. Also, be sure that all dirs leading to the simlinks are set to +x so that others can see the simlinks.

The above quote is from Homebrew's website: brew.sh

  • I went through the above regarding setting up Homebrew to work across multiple accounts, however, I had no success getting it to work on my standard account despite following the instructions verbatim – badfilms Oct 13 '15 at 18:01
  • Steps 4 and 6 of the guide add write perms for all brew users. Since you had Homebrew for a while before trying this, you may need to also add read and/or execute perms during those steps. If that doesn't work, I recommend using the second part of my answer to manually set perms on the shells you want to share. Once you're current problem is fixed, you can go back and decided how much you want to put into making Homebrew work for multiple users. – Tyler Abair Oct 13 '15 at 20:36
  • Perfect. Once I changed permissions to +x for /Cellar I was golden. brew is now working across both accounts as well as fish. Thanks Tyler – badfilms Oct 14 '15 at 7:45

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.