⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 managing_users.html

📁 ADI 公司blackfin系列的用户使用文挡。
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head>  <title></title>  <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />  <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />  <link rel="stylesheet" media="print" type="text/css" href="./print.css" />  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="level1"><div class="li"><span class="li"><a href="#managing_users" class="toc">Managing Users</a></span></div><ul class="toc"><li class="clear"><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#commands" class="toc">Commands</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#files" class="toc">Files</a></span></div></li></ul></li><li class="level2"><div class="li"><span class="li"><a href="#compiling_support_into_the_uclinux-dist" class="toc">Compiling Support into the uClinux-dist</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#examples" class="toc">Examples</a></span></div><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#adding_a_user" class="toc">Adding a User</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#changing_a_password" class="toc">Changing a Password</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#removing_a_user" class="toc">Removing a User</a></span></div></li></ul></li><li class="level2"><div class="li"><span class="li"><a href="#more_information" class="toc">More Information</a></span></div></li></ul></li></ul></div></div><h1><a name="managing_users" id="managing_users">Managing Users</a></h1><div class="level1"><p> It is often said that running as <code>root</code> or <code>superuser</code> on your desktop is bad idea, the same is true in your embedded environment. While many people just leave <code>root</code> as the only user in the embedded system, it should be understood that while this may be an acceptable practice, managing users in uClinux is the same as any other Linux system. To manage users, there are a few commands and files which you should understand. Many of these are part of Busybox, and can be compiled into or left out of the uClinux-dist.</p></div><!-- SECTION [1-555] --><h3><a name="commands" id="commands">Commands</a></h3><div class="level3"><p><code>addgroup</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_addgroup" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_addgroup"  rel="nofollow">Busybox Man</a><code>adduser</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_adduser" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_adduser"  rel="nofollow">Busybox Man</a><code>delgroup</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_delgroup" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_delgroup"  rel="nofollow">Busybox Man</a><code>deluser</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_deluser" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_deluser"  rel="nofollow">Busybox Man</a><code>getty</code><code>/bin/login</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_getty" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_getty"  rel="nofollow">Busybox Man</a><code>last</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_last" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_last"  rel="nofollow">Busybox Man</a><code>login</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_login" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_login"  rel="nofollow">Busybox Man</a><code>logname</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_logname" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_logname"  rel="nofollow">Busybox Man</a><code>su</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_su" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_su"  rel="nofollow">Busybox Man</a><code>sulogin</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_sulogin" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_sulogin"  rel="nofollow">Busybox Man</a><code>whoami</code><a href="http://www.busybox.net/downloads/BusyBox.html#item_whoami" class="urlextern" title="http://www.busybox.net/downloads/BusyBox.html#item_whoami"  rel="nofollow">Busybox Man</a></p></div><!-- SECTION [556-1968] --><h3><a name="files" id="files">Files</a></h3><div class="level3"><p><code>/etc/passwd</code>&rsquo;<code>/etc/shadow</code>&rsquo;<code>/etc/group</code><code>/etc/aliases</code>&rsquo;</p></div><!-- SECTION [1969-2377] --><h2><a name="compiling_support_into_the_uclinux-dist" id="compiling_support_into_the_uclinux-dist">Compiling Support into the uClinux-dist</a></h2><div class="level2"><p>Most of the utilities needed to properly manage users/groups can be found in <strong><em>Customize Vendor/User Settings &rarr; BusyBox &rarr;</em></strong> All of these utilties have two options:</p><ul><li class="level1"><div class="li"> use the system&rsquo;s password and group functions.  And if you are using the GNU C library (glibc), you will then need to install the /etc/nsswitch.conf configuration file and the required /lib/libnss_* libraries in order for the password and group functions to work.  This generally makes your embedded system quite a bit larger.</div></li><li class="level1"><div class="li"> allow busybox to directly access the system&rsquo;s <code>/etc/password</code>, and <code>/etc/group</code> files.  When this option is enabled, you will not be able to use PAM to access remote LDAP password servers.  And if you want hostname resolution to work with glibc, you still need the /lib/libnss_* libraries.</div></li></ul><p>This option is called <code>Use internal password and group functions rather than system functions</code>, and should be set for normal systems. <code>addgroup</code><code>adduser</code><code>delgroup</code><code>deluser</code><code>getty</code><code>last</code><code>login</code><code>logname</code><code>su</code><code>sulogin</code><code>whoami</code> </p></div><!-- SECTION [2378-3565] --><h2><a name="examples" id="examples">Examples</a></h2><div class="level2"></div><!-- SECTION [3566-3587] --><h3><a name="adding_a_user" id="adding_a_user">Adding a User</a></h3><div class="level3"><p>Add a user <code>foo</code> with default options: </p><pre class="code">root:~&gt; adduser foo</pre><p>Add a user <code>fooie</code> with a custom homedir: </p><pre class="code">root:~&gt; adduser -d /var/fooie fooie</pre><p>Add a user <code>mooie</code> with a custom shell: </p><pre class="code">root:~&gt; adduser -s /bin/false mooie</pre></div><!-- SECTION [3588-3872] --><h3><a name="changing_a_password" id="changing_a_password">Changing a Password</a></h3><div class="level3"><p>Change the active user&rsquo;s password: </p><pre class="code">root:~&gt; passwd</pre><p>Change the password of the user <code>foo</code>: </p><pre class="code">root:~&gt; passwd foo</pre></div><!-- SECTION [3873-4040] --><h3><a name="removing_a_user" id="removing_a_user">Removing a User</a></h3><div class="level3"><p>Delete the user <code>foo</code>: </p><pre class="code">root:~&gt; deluser foo</pre></div><!-- SECTION [4041-4125] --><h2><a name="more_information" id="more_information">More Information</a></h2><div class="level2"><p>For a good introductory book, you may want to look at <a href="http://www.amazon.com/gp/product/1565925858/103-3290203-3572629?v=glance&amp;n=283155" class="urlextern" title="http://www.amazon.com/gp/product/1565925858/103-3290203-3572629?v=glance&amp;n=283155"  rel="nofollow">Linux in a Nutshell</a>. </p></div><!-- SECTION [4126-] --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -