7.3.4. Create support files in /etc
7.3.4.1. /etc/issue
Create the file ~/staging/etc/issue using the example below or
design a customized message.
Connected to \l at \b bps. |
Note that "\l" is a lowercase letter L, not the number
one.
7.3.4.2. /etc/passwd
Use a text editor to create a minimal passwd file conforming to
the Linux Standards Base (LSB) document. Save the file as
~/staging/etc/passwd
root::0:0:Super User:/root:/bin/sh
bin:x:1:1:Legacy UID:/bin:/bin/false
daemon:x:2:2:Legacy UID:/sbin:/bin/false |
7.3.4.3. /etc/group
Use a text editor to create an LSB conforming group file and
save it as ~/staging/etc/group
root::0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon |
7.3.6. Set directory and file permissions
Set minimal privileges on all files and directories under
~/staging. Everything is owned by the root user and the root group.
Permissions are read-write for the owner and read-only for the group.
Exceptions to the blanket permissions are handled case by case.
cd ~/staging
chown -R 0:0 *
chmod -R 640 * |
Set execute permission on all directories. (Note capital X)
Files in /bin are read and execute for all, but su is an
exception.
chmod 755 bin/*
chmod 4750 bin/su |
Files in /dev have various permissions. Disk devices should be
accessible to administrators only. Other files like /dev/null should
have full privileges granted to everyone.
chmod 660 fd0 ram0
chmod 666 dev/null
chmod 644 dev/zero
chmod 622 dev/console
chmod 600 dev/initctl
chmod 622 dev/tty
chmod 622 dev/tty? |
The passwd and group files must be world readable.
chmod 644 etc/passwd
chmod 644 etc/group |
The scripts in /etc/init.d are read and execute for
administrators.
Libraries need read and execute permissions for everyone.
Only root should have access to the /root directory.
Make files in /sbin read and execute for administrators.
Temp should be read-write for all with the sticky bit set.