Comments on: rbash – A Restricted Bash Shell Explained with Practical Examples https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Fri, 22 Apr 2022 13:50:17 +0000 hourly 1 By: Andy https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/comment-page-1/#comment-1772778 Fri, 22 Apr 2022 13:50:17 +0000 http://www.tecmint.com/?p=5405#comment-1772778 You can run anything from a restricted bash shell, providing it’s in your path.

So to run, say, a python program, just put it in your path.

Running something, not in the path with an explicit path, eg, /bin/ls will fail:

rbash: /bin/ls: restricted: cannot specify `/' in command names

So the trick in having your restricted shell do what you want is to set the correct PATH, eg, PATH=/usr/rbash/bin in .bashrc. Remember the startup scripts do not run in restricted mode.

]]>
By: Ronan https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/comment-page-1/#comment-970424 Fri, 16 Feb 2018 12:22:39 +0000 http://www.tecmint.com/?p=5405#comment-970424 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?

]]>
By: tomj https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/comment-page-1/#comment-959498 Wed, 10 Jan 2018 19:46:43 +0000 http://www.tecmint.com/?p=5405#comment-959498 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.

]]>
By: Arun https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/comment-page-1/#comment-845048 Wed, 07 Dec 2016 09:56:37 +0000 http://www.tecmint.com/?p=5405#comment-845048 but executing commands over ssh just works , $ ssh some_host any_command

]]>
By: Ravi Saive https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/comment-page-1/#comment-789611 Wed, 08 Jun 2016 06:37:06 +0000 http://www.tecmint.com/?p=5405#comment-789611 In reply to mark.

@Mark,

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..

]]>