I have user test and I want to provide a bash script as a login shell for this user. I was able to do it on centOS 6 easily by using the command usermod -s /pathtomyscript.sh. But in centOS 7 I am unable to do it like this. I copied the script to /usr/bin and added it to /etc/shells. But still no luck. My script is the following:
#!/bin/bash PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/bin:/bin export PATH whiptail --title "Example Dialog" --msgbox "You are logged in and now click ok to exit!" 8 78 I am able to login by running su, but when I login into console, it is saying that no shell, permission denied. I have already given the proper permission to the file like the following:
-rwxr-xr-x. 1 test test 240 Jan 19 15:57 /usr/bin/testshell.sh 
grep | audit2allow