pwdgroup.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <sect1 id="ch06-pwdgroup">
  2. <title>Creating the passwd and group files</title>
  3. <?dbhtml filename="pwdgroup.html" dir="chapter06"?>
  4. <para>In order for <emphasis>root</emphasis> to be able to login and for the
  5. name "root" to be recognized, there need to be relevant entries in the
  6. <filename>/etc/passwd</filename> and
  7. <filename>/etc/group</filename> files. Also, to support one of the coreutils
  8. tests, we will also create the user and group nobody, which is almost
  9. universally present on Linux computers.</para>
  10. <para>Create the <filename>/etc/passwd</filename> file by running the
  11. following command:</para>
  12. <para><screen><userinput>cat &gt; /etc/passwd &lt;&lt; "EOF"</userinput>
  13. root:x:0:0:root:/root:/bin/bash
  14. nobody:x:1000:1000:nobody:/:/bin/bash
  15. <userinput>EOF</userinput></screen></para>
  16. <para>The actual password for <emphasis>root</emphasis> (the "x" here is
  17. just a placeholder) will be set later.</para>
  18. <para>Create the <filename>/etc/group</filename> file by running the
  19. following command:</para>
  20. <para><screen><userinput>cat &gt; /etc/group &lt;&lt; "EOF"</userinput>
  21. root:x:0:
  22. bin:x:1:
  23. sys:x:2:
  24. kmem:x:3:
  25. tty:x:4:
  26. tape:x:5:
  27. daemon:x:6:
  28. floppy:x:7:
  29. disk:x:8:
  30. lp:x:9:
  31. dialout:x:10:
  32. audio:x:11:
  33. nobody:x:1000:
  34. <userinput>EOF</userinput></screen></para>
  35. <para>The created groups aren't part of any standard -- they are the groups
  36. that the MAKEDEV script in the next section uses. Besides the group "root",
  37. the LSB (<ulink url="http://www.linuxbase.org"/>) recommends only a group
  38. "bin", with a GID of 1, be present. All other group names and GIDs can be
  39. chosen freely by the user, as well-written packages don't depend on GID
  40. numbers but use the group's name.</para>
  41. <para><screen><userinput>exec /tools/bin/bash --login
  42. set +h</userinput></screen></para>
  43. </sect1>