<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>庆亮的博客-webgame架构 &#187; shell</title>
	<atom:link href="http://www.qingliangcn.com/tag/shell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.qingliangcn.com</link>
	<description>关注LAMP&#124;PHP源代码分析&#124;web架构&#124;PHP扩展&#124;Erlang&#124;服务端架构</description>
	<lastBuildDate>Wed, 11 Aug 2010 15:25:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>su后“不能”使用某些超级命令的解决</title>
		<link>http://www.qingliangcn.com/2009/07/su%e5%90%8e%e4%b8%8d%e8%83%bd%e4%bd%bf%e7%94%a8%e6%9f%90%e4%ba%9b%e8%b6%85%e7%ba%a7%e5%91%bd%e4%bb%a4%e7%9a%84%e8%a7%a3%e5%86%b3/</link>
		<comments>http://www.qingliangcn.com/2009/07/su%e5%90%8e%e4%b8%8d%e8%83%bd%e4%bd%bf%e7%94%a8%e6%9f%90%e4%ba%9b%e8%b6%85%e7%ba%a7%e5%91%bd%e4%bb%a4%e7%9a%84%e8%a7%a3%e5%86%b3/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 03:43:04 +0000</pubDate>
		<dc:creator>庆亮</dc:creator>
				<category><![CDATA[Linux/Unix/BSD]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[su]]></category>

		<guid isPermaLink="false">http://www.nd21.com/?p=73</guid>
		<description><![CDATA[一个基础问题而已。从普通用户使用su之后，某些命令无法使用，如： bash: usermod: command not found 命令存在，也有了root权限，为何提示&#8220;命令找不到&#8221;，想一想就明白了是环境变量的问题（PATH）。man su，第一个参数告诉了我们真相。 -, -l, &#8211;login &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; make the shell a login shell 使用这个选项用于在su的同时（成功的情况下）更换到对应用户的shell，也就是说正常情况下，我们su之后只是获得了root权限，但是shell还是之前的普通权限用户的shell，而普通用户shell的PATH通常是没有/usr/sbin等目录的。解决方法： 1.添加这些超级工具目录到PATH 2.使用su &#8211; 来切换到root权限 3.使用命令的完全路径，如/usr/sbin/usermod]]></description>
			<content:encoded><![CDATA[<p>一个基础问题而已。从普通用户使用su之后，某些命令无法使用，如：</p>
<p>bash: usermod: command not found</p>
<p>命令存在，也有了root权限，为何提示&ldquo;命令找不到&rdquo;，想一想就明白了是环境变量的问题（PATH）。man su，第一个参数告诉了我们真相。</p>
<blockquote>
<p>-, -l, &#8211;login<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; make the shell a login shell</p>
</blockquote>
<p>
使用这个选项用于在su的同时（成功的情况下）更换到对应用户的shell，也就是说正常情况下，我们su之后只是获得了root权限，但是shell还是之前的普通权限用户的shell，而普通用户shell的PATH通常是没有/usr/sbin等目录的。解决方法：</p>
<p>1.添加这些超级工具目录到PATH</p>
<p>2.使用su &#8211; 来切换到root权限</p>
<p>3.使用命令的完全路径，如/usr/sbin/usermod</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qingliangcn.com/2009/07/su%e5%90%8e%e4%b8%8d%e8%83%bd%e4%bd%bf%e7%94%a8%e6%9f%90%e4%ba%9b%e8%b6%85%e7%ba%a7%e5%91%bd%e4%bb%a4%e7%9a%84%e8%a7%a3%e5%86%b3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

