rbash – A Restricted Bash Shell Explained with Practical Examples

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

10 Responses

  1. Ronan says:

    Useful post, if I wanted to run a section of code, say a python file in restricted mode, how would I go about doing that?

  2. tomj says:

    I was concerned that defining a symolic link “ln -s bash rbash” would cause rbash to run an unrestricted bash shell. That was not the case on my Fedora system. “rbash” obviously runs the standard bash executable, but the restrictions are enforced.

    So the bash executable must examine the command used to invoke it, and if the name is “rbash”, then the restrictions are applied. Neat.

  3. Arun says:

    but executing commands over ssh just works , $ ssh some_host any_command

  4. mark says:

    pointless post. tells me nothing other than what rbash is.

    • Ravi Saive says:


      I totally agree with your comment, yes we only covered about rbash only, no any usage about rbash, but we will planning to add usage of rbash to this article..

  5. Biroute says:

    “When users run bash or dash from rbash then they got unrestricted shells” so how do we deal with that important problem??

    What can be read on this page is basically what comes out of the ‘man’ page.

  6. Max says:

    After reading this article I’m still trying to get something useful from it, besides the description of rbash.
    There are no examples of configuration, also there are no examples of modification of it base configuration.
    No real case of use for this shell in a production environment, as CentOS and RHEL are mentioned.
    – Can it be used as a default shell for a user? because the user wouldn’t run it if they have the chance.

    Thanks for the article, but it just looks incomplete and not entirely true to the title.

    • Javier says:

      Hi Max, yes you can run it on the default shell of the user, you have to edit /etc/passwd file and change on the user /bin/bash for /bin/rbash

  7. ashish says:

    nice post

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.