Cannot exec /bin/false: no such file or directory
Solution 1
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.
Solution 2
Go to preferences on Terminal and then go to general,then under 'Shell open with' select Command and type bash -l
Related videos on Youtube
Em Fhal
Updated on September 18, 2022Comments
-
Em Fhal over 1 year
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 tosh
, it gives the same error.However, when I execute
screen
command assudo
, then the command succeeds.How do I resolve it for the normal user?
-
Admin almost 8 yearsSearch for
/bin/false
in your rc-files (.bashrc
,.bash_profile
etc.) Also check your.screenrc
.
-
-
Em Fhal almost 8 yearsSorry, 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. :)
-
Kusalananda almost 8 years@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
-
guntbert over 5 yearsPlease explain what this does and how it solves the problem.
-
Reb.Cabin about 5 yearsis that "bash -<Capital Eye>" or "bash-<Uncial Ell>" ?
-
Reb.Cabin over 4 yearsbest answer this is