pwdgroup.xml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <sect1 id="ch05-pwdgroup">
  2. <title>Creating passwd and group files</title>
  3. <para>
  4. In order for the user and group root to be recognized and to be able to login,
  5. there needs to be an entry in the /etc/passwd and /etc/group file. Besides the
  6. group root a couple of other groups are recommended and needed by
  7. packages. The groups with their GID's below aren't part of any standard.
  8. The LSB only recommends besides a group root a group bin to be present
  9. with GID 1. Other group names and GID's can be chosen by the user. Well
  10. written packages don't depend on GID numbers but just use the group
  11. name, since it doesn't matter all that much what GID a group has. Since there
  12. aren't any standards for groups I won't follow any conventions used by
  13. Debian, RedHat and others. The groups added here are the groups the
  14. MAKEDEV script (the script that creates the device files in the /dev
  15. directory) mentions.
  16. </para>
  17. <para>
  18. Create a new file <filename>$LFS/etc/passwd</filename> by running the
  19. following command:
  20. </para>
  21. <para>
  22. <screen>
  23. <userinput>echo "root:x:0:0:root:/root:/bin/bash" &gt; $LFS/etc/passwd
  24. </userinput>
  25. </screen>
  26. </para>
  27. <para>
  28. Create a new file <filename>$LFS/etc/group</filename> by running the
  29. following:
  30. </para>
  31. <para>
  32. <screen>
  33. <userinput>cat &gt; $LFS/etc/group &lt;&lt; "EOF"</userinput>
  34. root:x:0:
  35. bin:x:1:
  36. sys:x:2:
  37. kmem:x:3:
  38. tty:x:4:
  39. tape:x:5:
  40. daemon:x:6:
  41. floppy:x:7:
  42. disk:x:8:
  43. lp:x:9:
  44. dialout:x:10:
  45. audio:x:11:
  46. <userinput>EOF</userinput>
  47. </screen>
  48. </para>
  49. </sect1>