Getting error as failed to execute /bin/bash : Permission denied for ssh and su commands.
Issue
-
While trying to putty or ssh from terminal to non-root users, getting error below and ssh session gets terminated.
$ ssh -vvv username@server-ip /bin/bash : Permission denied
-
For su to non-root user, getting similar errors
# su - username Failed to execute /bin/bash : Permission denied
-
The /var/log/secure file shows connection closed by user.
Environment
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.