9

I'm trying to open GNU Screen with the following command on my Mac OS:

host:~ user$ screen

The screen terminal opens but quickly dies with the error message:

Cannot exec /bin/false: no such file or directory

My terminal is configured to open bash shell on startup. I've tried setting the terminal shell to sh, it gives the same error.

However, when I execute screen command as sudo, then the command succeeds.

How do I resolve it for the normal user?

  • 1
    Search for /bin/false in your rc-files (.bashrc, .bash_profile etc.) Also check your .screenrc. – choroba Jul 13 '16 at 14:25
8

Have a look in your shell initialisation scripts for bash, or the screen config file, and see if there's anywhere false is being used with the explicit path /bin/false.

On macOS, the false utility is located in /usr/bin, not in /bin.

Failing that, see if your login shell for some odd reason is set to /bin/false, either by inspecting /etc/passwd or looking at the "Advanced Options" in the "User & Groups" section of the System Preferences (you get these by right-clicking on your user in the list of user accounts, and you may change the shell here too). Someone may have unthinkingly followed a tutorial/HOWTO which sets up a user with /bin/false as their default shell.

When you run screen with sudo you use root's shell/screen init files. This is why that works.

  • 2
    Sorry, pressing enter accidentally posted the incomplete comment. I checked the following files: /etc/passwd and ~/.screenrc. However, it seems my shell was setup with /bin/false as default shell. When I did an "echo $SHELL" it gave "/bin/false". Doing an "export SHELL=/bin/bash" fixed the issue. :) – sultan.of.swing Jul 14 '16 at 7:09
  • @sultan.of.swing Good! You should change your default shell in the System Preferences. Also, if this solves your issue, please consider accepting the answer – Kusalananda Jul 14 '16 at 7:17
1

Go to preferences on Terminal and then go to general,then under 'Shell open with' select Command and type bash -l

  • 3
    Please explain what this does and how it solves the problem. – guntbert Sep 4 '18 at 19:05
  • is that "bash -<Capital Eye>" or "bash-<Uncial Ell>" ? – Reb.Cabin Mar 26 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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