📄 linux 系统中的超级权限的控制 linuxsir_org.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0040)http://www.linuxsir.org/main/?q=node/104 -->
<HTML lang=zh-hans xml:lang="zh-hans"
xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Linux 系统中的超级权限的控制 | LinuxSir.Org</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<STYLE type=text/css media=all>@import url( misc/drupal.css );
</STYLE>
<STYLE type=text/css media=all>@import url( modules/taxonomy_context/taxonomy_context.css );
</STYLE>
<LINK media=screen
href="Linux 系统中的超级权限的控制 LinuxSir_Org.files/menuExpandable3.css" type=text/css
rel=stylesheet>
<SCRIPT src="Linux 系统中的超级权限的控制 LinuxSir_Org.files/menuExpandable3.js"
type=text/javascript></SCRIPT>
<LINK href="Linux 系统中的超级权限的控制 LinuxSir_Org.files/common.css" type=text/css
rel=stylesheet>
<STYLE type=text/css media=all>@import url( themes/chameleon/marvin/style.css );
</STYLE>
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV id=header><A title=Home href="http://www.linuxsir.org/main/"><IMG alt=Home
src="Linux 系统中的超级权限的控制 LinuxSir_Org.files/logo.jpg"></A></DIV>
<DIV class=navlinks>
<DIV class=primary><A href="http://www.linuxsir.org/main/?q"><FONT
color=white>首页</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=taxonomy/term/34"><FONT
color=white>事件</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=taxonomy/term/1/25/"><FONT
color=white>文档</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=taxonomy/term/35/48/"><FONT
color=white>资源</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=search"><FONT color=white>搜索</FONT></A> |
<A href="http://www.linuxsir.org/bbs"><FONT color=white>论坛</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=taxonomy/term/38"><FONT
color=white>贡献者</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=node/3"><FONT color=white>关于</FONT></A> |
<A href="http://www.linuxsir.org/main/?q=user"><FONT
color=white>注册/登录</FONT></A></DIV></DIV>
<TABLE id=content>
<TBODY>
<TR>
<TD id=sidebar-left>
<DIV class="block block-block" id=block-block-1>
<H2 class=title>子站索引</H2>
<DIV class=content>
<UL>
<LI><A href="http://fedora.linuxsir.org/" target?_blank?>Fedora中文</A>
<LI><A href="http://debian.linuxsir.org/" target?_blank?>Debian中文</A>
<LI><A href="http://lfs.linuxsir.org/" target?_blank?>LFS 中文</A>
<LI><A href="http://slack.linuxsir.org/">Slackware</A>
<LI><A href="http://gentoo.linuxsir.org/">Gentoo中文</A>
<LI><A href="http://arch.linuxsir.org/">Arch 中文</A> </LI></UL></DIV></DIV>
<DIV class="block block-block" id=block-block-3>
<H2 class=title>重要资讯</H2>
<DIV class=content>
<UL>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/36">本站公告</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/34">新闻事件</A>
<LI><A href="http://www.linuxsir.org/bbs" target=_blank>本站论坛</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/38">贡 献 者</A>
</LI></UL></DIV></DIV>
<DIV class="block block-block" id=block-block-7>
<H2 class=title>项目索引</H2>
<DIV class=content>
<UL>
<LI><A href="http://www.fcitx.org/" target=_blank>小企鹅输入法</A>
<LI><A href="http://lumaqq.linuxsir.org/" target=_blank>LumaQQ</A>
<LI><A href="http://openq.linuxsir.org/" target=_blank>OpenQ</A>
<LI><A href="http://www.relaxbsd.org/" target=_blank>RelaxBSD</A>
</LI></UL></DIV></DIV>
<DIV class="block block-user" id=block-user-1>
<H2 class=title>站点导航</H2>
<DIV class=content>
<DIV class=menu>
<UL>
<LI class=leaf><A title=注册/登录
href="http://www.linuxsir.org/main/?q=user">注册/登录</A>
<LI class=collapsed><A
href="http://www.linuxsir.org/main/?q=aggregator">新闻聚合</A>
</LI></UL></DIV></DIV></DIV>
<DIV class="block block-aggregator" id=block-aggregator-feed-2>
<H2 class=title>LinuxSir.Org 论坛</H2>
<DIV class=content>
<DIV class=item-list>
<UL>
<LI><A
href="http://www.linuxsir.org/bbs/showthread.php?t=266992&goto=newpost">MTD工具制作问题</A>
<LI><A
href="http://www.linuxsir.org/bbs/showthread.php?t=266991&goto=newpost">好久没来了,原来家里没条件上网:)</A>
<LI><A
href="http://www.linuxsir.org/bbs/showthread.php?t=266990&goto=newpost">想求一个终端软件</A>
<LI><A
href="http://www.linuxsir.org/bbs/showthread.php?t=266989&goto=newpost">求助!!关于AMSN和wxdfast</A>
<LI><A
href="http://www.linuxsir.org/bbs/showthread.php?t=266988&goto=newpost">出现这样的gtk-waring怎么半?</A>
</LI></UL></DIV>
<DIV class=more-link><A title=查看此feed的最新消息
href="http://www.linuxsir.org/main/?q=aggregator/sources/2">更多</A></DIV></DIV></DIV>
<DIV class="block block-user" id=block-user-2>
<H2 class=title>最新注册</H2>
<DIV class=content>
<DIV class=item-list>
<UL>
<LI>zionsaint
<LI>haphap
<LI>AndyWang
<LI>mi8421
<LI>wt2977</LI></UL></DIV></DIV></DIV>
<DIV class="block block-user" id=block-user-3>
<H2 class=title>当前在线</H2>
<DIV class=content>0 users 和 55 游客 在线</DIV></DIV></TD>
<TD id=main>
<DIV class=breadcrumb><A href="http://www.linuxsir.org/main/?q=">首页</A> »
<A href="http://www.linuxsir.org/main/?q=taxonomy/term/1">Linux</A></DIV>
<H2>Linux 系统中的超级权限的控制</H2><!-- begin content -->
<DIV class=node>
<DIV class=content>
<P><B>作者:</B>北南南北<BR><B>赞助:</B> eTony,pandonny,懒猫,
Arch<BR><B>来自:</B>LinuxSir.Org<BR><B>摘要:</B>
超级用户是系统最高权限的拥有者,是系统管理唯一的胜任者;由于权限的超级并且达到无所不能的地步,如果管理不擅,必会对系统安全造成威胁。
除了尽可能的避免用直接用超级用户root登录系统外,我们还要学会在普通用户下临时切换到超级用户root下完成必要的系统管理工作;从用户管理和系统安全角度来说是极有意义的;</P>
<P>本文对普通用户切换到root用户的实现命令 su 和sudo 做了实例解说;希望能为初学者学习带来方便;</P>
<P><FONT size=4><B><BR>目录索引<BR></B></FONT></P>
<P><A
href="http://www.linuxsir.org/main/?q=node/104#1"><B>一、对超级用户和普通用户的理解;</B></A></P>
<UL><A
href="http://www.linuxsir.org/main/?q=node/104#1.1">1、什么是超级用户;</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#1.2">2、理解 UID
和用户的对应关系</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#1.3">3、普通用户和伪装用户</A> </UL>
<P><A href="http://www.linuxsir.org/main/?q=node/104#2"><B>二.
超级用户(权限)在系统管理中的作用</B></A></P>
<UL><A
href="http://www.linuxsir.org/main/?q=node/104#2.1">1、对任何文件、目录或进程进行操作;</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#2.2">2、对于涉及系统全局的系统管理;</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#2.3">3、超级权限的不可替代性;</A>
</UL>
<P><A href="http://www.linuxsir.org/main/?q=node/104#3"><B>三、使用 su
命令临时切换用户身份;</B></A></P>
<UL><A href="http://www.linuxsir.org/main/?q=node/104#3.1">1、su
的适用条件和威力;</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#3.2">2、su 的用法;</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#3.3">3、su 的范例;</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#3.4">4、su 的优缺点</A> </UL>
<P><A href="http://www.linuxsir.org/main/?q=node/104#4"><B>四、sudo
授权许可使用的su,也是受限制的su</B></A></P>
<UL><A href="http://www.linuxsir.org/main/?q=node/104#4.1">1. sudo
的适用条件;</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#4.2">2、从编写 sudo
配置文件/etc/sudoers开始;</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#4.3">3、/etc/sudoers
配置文件中别名规则</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#4.4">4、/etc/sudoers中的授权规则:</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#4.5">5、/etc/sudoers中其它的未尽事项;</A><BR><A
href="http://www.linuxsir.org/main/?q=node/104#4.6">6、sudo的用法;</A> </UL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -