LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   shell error:cd: restricted shell - can't cd (https://www.linuxquestions.org/questions/linux-newbie-8/shell-error-cd-restricted-shell-cant-cd-938075/)

nishanthp82 04-04-2012 09:39 AM

shell error:cd: restricted shell - can't cd
 
when i try to execuete a script with param iam getting this error

#### Calling parm file.
. /psoft/batch/fsdev/scripts/parms/test_ae.parm
./batchae7: /psoft/batch/fsdev/scripts/parms/test_ae.parm[3]: cd: restricted shell - can't cd

./batchae7: /psoft/batch/fsdev/scripts/parms/test_ae.parm[13]: /psoft/batch/fsdev/log_output/grepfile.test_ae: restricted

./batchae7: /psoft/batch/fsdev/scripts/parms/test_ae.parm[14]: /psoft/batch: restricted

Any thoughts why iam facing this?

druuna 04-04-2012 10:08 AM

Hi,

You either choose to use a restricted shell yourself (bash -r for example). In That case the solution is simple: Don't use the -r option :)

Or you are getting a restricted shell/environment by your Provider/IT department/School/etc/etc for security reasons. In that case: You are probably out of luck, but you can ask them if you could get an unrestricted/less restricted shell/environment (answer will probably be: No!).

Also have a look here: Restricted shell

Hope this helps.

nishanthp82 04-04-2012 11:12 AM

Thanks for your reply

But we are not using any restricted shell.i can see iam in rush shell.

how to check if iam in restricted shell or not?
how to come out of restricted shell?

i see my home dir /psoft/batch are in differnt group than other dir?will this be a issue?

druuna 04-04-2012 11:38 AM

Hi,
Quote:

Originally Posted by nishanthp82 (Post 4644623)
Thanks for your reply

But we are not using any restricted shell.i can see iam in rush shell.

Yes, you are using a restricted shell :)
rush shell => restricted user shell

Have a look here: GNU Rush

Quote:

how to come out of restricted shell?
You don't, that is the point of the restriction.

Quote:

i see my home dir /psoft/batch are in differnt group than other dir?will this be a issue?
Permissions can be a problem, but if I look at your original post I see this:
Quote:

./batchae7: /psoft/batch/fsdev/scripts/parms/test_ae.parm[3]: cd: restricted shell - can't cd
./batchae7: /psoft/batch/fsdev/scripts/parms/test_ae.parm[13]: /psoft/batch/fsdev/log_output/grepfile.test_ae: restricted
./batchae7: /psoft/batch/fsdev/scripts/parms/test_ae.parm[14]: /psoft/batch: restricted
All point to a violation of the shell and not a permissions problem.

Here a link to the rush man page. It does tell you a lot about what is and isn't allowed.

Hope this helps.

nishanthp82 04-04-2012 12:28 PM

ok.Thanks for your detailed explanation

But iam using the same shell(rush) in differnt server ,the script is executing fine without any issues.

Any idea why script is executing success?


All times are GMT -5. The time now is 03:47 AM.