Super User Asked on December 5, 2021
After adding a user as sudoers as, su to this user fails with error message:
Cannot execute /bin/bash
: No such file or directory
I googled and found a lot of similar issue, mostly due to /etc/passwd file not being correct. It does not seem to be the case here as /bin/bash is a valid path.
Also, the two blank spaces in the error message is not a typo. They are on the error message.
su to other users works fine.
Also I copied the .bashrc file of a user for which ‘su’ was successful, but no success.
The .profile file does not seem to have anything special either.
I am not sure what I should look at next
This indeed looks like an issue with /etc/passwd
. You should have an extra space there, and since the separator of passwd
file is ":", that extra space is considered to be part of the name of the shell, e.g. " /bin/bash"
or "/bin/bash "
.
Check /etc/passwd
for anomalies (trailing spaces, etc.) If nothing helps, delete the line corresponding to that user and add the user again via useradd
.
Answered by Dmitry Grigoryev on December 5, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP