Trying to execute bash script upon login??
Hi Everyone,
I am using Redhat 9 and am somewhat of a newbie. I have a bash menu script i am trying to execute for some users. I have given the script the correct permissions and ownership, and set the shell to /bin/scriptname in the passwd file, but when i log on as one of these users i just get: /bin/scriptname: Permission Denied I can't figure out what i have missed. Any help would be appreciated. Thanks, Alan |
it's probably still not exectuable.... chmod +x scriptname also make sure it has a valid interpreter listed at the top.
/bin isn't a good place to put a file you created yourself though... /usr/local/bin would be more normal. |
It has execute permissions. I think it may have something to do with /root/.bashrc as i dont want the script to be executed as root, and the bash commands in the script seem to need access to /root/.bashrc.
I am wandering if there is something else that needs to happen because the shell information in the password file is (now) /usr/local/bin/scriptname instead of /bin/bash?? If i execute the script as root it works perfectly? Its only when i log in with a user that is set to run the script instead of /bin/bash?? Thanks again for your help. Cheers, Alan |
You probably don't want a generic login script trying to run /root/.bashrc. What you probably want to do is change the invocation of /root/.bashrc to $HOME/.bashrc.
If a user other than root logs in, the script can't run /root/.bashrc, which is private to root. |
Don't you want an entry in .bashrc or .bash_profile to run the script every time the user logs in?
The script isn't an actual login shell, is it? If not, you don't want it listed in /etc/passwd. |
All times are GMT -5. The time now is 07:54 PM. |