LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shell Script in rbash (https://www.linuxquestions.org/questions/linux-newbie-8/shell-script-in-rbash-4175413765/)

benjam1nrk 06-27-2012 10:43 PM

Shell Script in rbash
 
I have an account configured to utilize rbash as its shell.

I am able to successfully create links to binaries that can be executed by the restricted shell user without problem.

However, how do I go about providing the user with the ability to execute shell scripts from his command line?

For example, I have the bash script:
Code:

#!/bin/bash
/bin/ls
echo "I am finished"

Is it possible to run this script by the restricted shell user without getting the error "-rbash: /bin/ls: restricted: cannot specify `/' in command names"?

I was somewhat under the assumption that the script would execute in the unrestricted bash shell.

kinneyd 06-28-2012 01:56 AM

Instead of calling /bin/ls , try just calling ls. The restricted shell doesn't want you to use the "/" character in your command names. I believe the restricted shell is going to limit you to commands found in your path.

benjam1nrk 06-30-2012 10:03 AM

Quote:

Originally Posted by kinneyd (Post 4713875)
Instead of calling /bin/ls , try just calling ls. The restricted shell doesn't want you to use the "/" character in your command names. I believe the restricted shell is going to limit you to commands found in your path.

Thank you, I believe this is the case.


All times are GMT -5. The time now is 10:36 PM.