?? ch04_08.htm
字號:
<html><head><title>Restricted Shells (UNIX in a Nutshell: System V Edition)</title><link rel="stylesheet" type="text/css" href="../style/style1.css" /><meta name="DC.Creator" content="Arnold Robbins" /><meta name="DC.Format" content="text/xml" scheme="MIME" /><meta name="DC.Language" content="en-US" /><meta name="DC.Publisher" content="O'Reilly & Associates, Inc." /><meta name="DC.Source" scheme="ISBN" content="1-56592-427-4" /><meta name="DC.Subject.Keyword" content="stuff" /><meta name="DC.Title" content="UNIX in a Nutshell: System V Edition" /><meta name="DC.Type" content="Text.Monograph" /></head><body bgcolor="#ffffff"><img src="gifs/smbanner.gif" usemap="#banner-map" border="0" alt="Book Home" /><map name="banner-map"><area shape="rect" coords="1,-2,616,66" href="index.htm" alt="Book Title" /><area shape="rect" coords="629,-11,726,25" href="jobjects/fsearch.htm" alt="Search this book" /></map><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch04_07.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228" /><td align="right" valign="top" width="228"><a href="ch04_09.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr></table></div><h2 class="sect1">4.8. Restricted Shells</h2><p><a name="unut-ch-4-ix-restricted-shells" /><a name="unut-ch-4-ix-shells-restricted" /><a name="unut-ch-4-ix-sh-bourne-shell-setting-restrictions-on" /><a name="unut-ch-4-ix-ksh-korn-shell-setting-restrictions-on" />Restricted shells can be invoked in any of the following ways:</p><blockquote><pre class="code">rksh <i class="lineannotation">Korn shell</i>ksh -rset -r/usr/lib/rsh <i class="lineannotation">Bourne shell</i>set -r</pre></blockquote><p><a name="IXT-4-122811" /><a name="IXT-4-122812" />Restricted shells can also be set up by supplyingthe full pathname to<tt class="literal">rksh</tt> or <tt class="literal">rsh</tt>in the shell field of <tt class="literal">/etc/passwd</tt>or by using them as the value for the SHELL variable.</p><p>Restricted shells act the same as their nonrestrictedcounterparts, except that the following are prohibited:</p><ul><li><p>Changing directory (i.e., using <tt class="literal">cd</tt>).</p></li><li><p>Setting the PATH variable. <tt class="literal">rksh</tt> alsoprohibits setting ENV and SHELL.</p></li><li><p>Specifying a <tt class="literal">/</tt> for command names or pathnames.</p></li><li><p>Redirecting output (i.e., using <tt class="literal">></tt> and <tt class="literal">>></tt>).<tt class="literal">ksh</tt> also prohibits the use of <tt class="literal"><></tt>.</p></li><li><p>Adding new built-in commands (<tt class="literal">ksh93</tt>).</p></li></ul><p>Shell scripts can still be run, since in that casethe restricted shell calls <tt class="literal">ksh</tt>or <tt class="literal">sh</tt> to run the script.This includes the <tt class="literal">/etc/profile</tt>,<tt class="literal">$HOME/.profile</tt>, and $ENV files.</p><p>Restricted shells are not used much in practice, as theyare difficult to set up correctly.</p><a name="IXT-4-122813" /><a name="IXT-4-122814" /><a name="IXT-4-122815" /><a name="IXT-4-122816" /><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch04_07.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0" /></a></td><td align="right" valign="top" width="228"><a href="ch04_09.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td align="left" valign="top" width="228">4.7. Invoking the Shell</td><td align="center" valign="top" width="228"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0" /></a></td><td align="right" valign="top" width="228">4.9. Built-in Commands </td></tr></table></div><hr width="684" align="left" /><img src="../gifs/navbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links" /><p><p><font size="-1"><a href="copyrght.htm">Copyright © 2003</a> O'Reilly & Associates. All rights reserved.</font></p><map name="library-map"><area shape="rect" coords="1,0,88,96" href="../index.htm"><area shape="rect" coords="90,0,165,96" href="../upt/index.htm"><area shape="rect" coords="168,1,253,107" href="../mac/index.htm"><area shape="rect" coords="255,0,335,97" href="../korn/index.htm"><area shape="rect" coords="337,0,415,109" href="../unixnut/index.htm"><area shape="rect" coords="417,0,512,122" href="../sedawk/index.htm"><area shape="rect" coords="514,0,605,105" href="../lunix/index.htm"><area shape="rect" coords="611,2,694,121" href="../vi/index.htm"></map></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -