Skip to Main Content
bash Pocket Reference
book

bash Pocket Reference

by Arnold Robbins
May 2010
Beginner to intermediate content levelBeginner to intermediate
130 pages
3h 20m
English
O'Reilly Media, Inc.
Content preview from bash Pocket Reference

Restricted Shells

A restricted shell is one that disallows certain actions, such as changing directory, setting PATH, or running commands whose names contain a / character.

The original V7 Bourne shell had an undocumented restricted mode. Later versions of the Bourne shell clarified the code and documented the facility. Bash also supplies a restricted mode. (See the manual page for the details.)

Shell scripts can still be run, since in that case the restricted shell calls the unrestricted version of the shell to run the script. This includes /etc/profile, $HOME/.profile, and the other startup files.

Restricted shells are not used much in practice, as they are difficult to set up correctly.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Bash Pocket Reference, 2nd Edition

Bash Pocket Reference, 2nd Edition

Arnold Robbins
bash Quick Reference

bash Quick Reference

Arnold Robbins
Mastering Bash

Mastering Bash

Giorgio Zarrelli

Publisher Resources

ISBN: 9781449388669Errata Page