Библиотека сайта rus-linux.net
7.3. Construction
7.3.2. Modify inittab for multi-user mode
Modify ~/staging/etc/inittab
by changing the
default runlevel and adding getty entries as shown
below.
# /etc/inittab - init daemon configuration file # # Default runlevel id:2:initdefault: # # System initialization si:S:sysinit:/etc/init.d/rc S # # Runlevel scripts r0:0:wait:/etc/init.d/rc 0 r1:1:respawn:/bin/sh r2:2:wait:/etc/init.d/rc 2 r3:3:wait:/etc/init.d/rc 3 r4:4:wait:/etc/init.d/rc 4 r5:5:wait:/etc/init.d/rc 5 r6:6:wait:/etc/init.d/rc 6 # # Spawn virtual terminals 1:235:respawn:/sbin/getty 38400 tty1 linux 2:235:respawn:/sbin/getty 38400 tty2 linux 3:235:respawn:/sbin/getty 38400 tty3 linux 4:235:respawn:/sbin/getty 38400 tty4 linux 5:235:respawn:/sbin/getty 38400 tty5 linux 6:2345:respawn:/sbin/getty 38400 tty6 linux # # end of /etc/inittab |
7.3.3. Create tty devices
|
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. |
Be sure that "\l" is a lowercase letter L and 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.5. Copy required libraries
|
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.
|
Set execute permission on all directories. (Note the capital "X")
|
Files in /bin
are read and execute for all,
but su
is an exception.
|
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.
|
The passwd
and group
files must be world readable.
|
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.
|