I'm trying to use a specific bash script as a user shell. So that if the user logs in, the script will be executed.
I've created the script and placed it into the home directory for the specific user. I modified /etc/passwd
to use the script as a shell for this user.
This works great if I'm login locally. But if I try to login over SSH, I get the following error:
/home/user/custom-shell: No such file or directory
Connection to xyz closed.
The path to this script is correct since I'm able to login locally and can see that the script will be executed.
I also tried to change the permission using chmod 777 custom-shell
, but that didn't help either.
Do you have an idea what's the problem?