Creating passwd and group files

In order for user and group root to be recognized and to be able to logon it needs an entry in the /etc/passwd and /etc/group file. Besides the group root a couple of other groups are recommended and needed by packages. The groups with their GID's below aren't part of any standard. The LSB only recommends besides a group root a group bin to be present with GID 1. Other group names and GID's can be chosen by yourself. Well written packages don't depend on GID numbers but just use the group name, it doesn't matter all that much what GID a group has. Since there aren't any standards for groups I won't follow any conventions used by Debian, RedHat and others. The groups added here are the groups the MAKEDEV script (the script that creates the device files in the /dev directory) mentions.

Create a new file $LFS/etc/passwd by running the following command:



echo "root:x:0:0:root:/root:/bin/bash" > $LFS/etc/passwd

Create a new file $LFS/etc/group by running the following command:



echo "root:x:0:" > $LFS/etc/group &&
echo "bin:x:1:" >> $LFS/etc/group &&
echo "sys:x:2:" >> $LFS/etc/group &&
echo "kmem:x:3:" >> $LFS/etc/group &&
echo "tty:x:4:" >> $LFS/etc/group &&
echo "uucp:x:5:" >> $LFS/etc/group &&
echo "daemon:x:6:" >> $LFS/etc/group &&
echo "floppy:x:7:" >> $LFS/etc/group &&
echo "disk:x:8:" >> $LFS/etc/group