My Debian Tips:

Boot
File Systems
Graphics
Miscellaneous
Mouse
Packaging
Security
Sound
Storage Devices

[Tips Home] [Home]

 
Valid HTML 4.01!
 
Tips on working with Boot or Shutdown Sequence on Debian Linux:

How to avoid fsck prompts during the boot sequence?

Write 'FSCKFIX=yes' in /etc/default/rcS. You will not face the fsck problem from the next reboot onwards. However, if the disk is corrupted very badly, your presence may be required. I had done some kernel tweaks also for that. I will write about in subsequent tips.

Disabling 'shutdown' with Cntl+Alt+Del

If you get annoyed, when you accidentally rebooted the system by pressing the three magic keys, comment out this line in /etc/inittab as,

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

You may alternatively allow specific users with this capability by changing the line as below and adding the specific login ids in '/etc/shutdown.allow',

ca::ctrlaltdel:/sbin/shutdown -a -t3 -r now

How do I disable root login over network?

The /etc/securetty file lists the devices on which "root" may log in. If you remove all entries except for tty1 through tty8, you'll prevent network logins for root.
    ttyS* are serial devices (e.g., a modem or serial-connected terminal)
    ttyp*, ttyq*, etc are network terminals


I forgot the root password ;-(

Oh yes, it is indeed possible to boot your system and log on to the root account without knowing the root password, as long as one has an access to the console keyboard. However I am assuming that your BIOS does not pose any new problems.

Press shift key at the boot prompt and enter as, boot: Linux init=/bin/sh
This causes the system to boot the default linux kernel (with lable as 'linux') and run /bin/sh instead of its standard init. Now you have gained root privileges and a root shell. / is currently mounted read-only and many disk partitions have not been mounted yet.
# mount -n -t remount,rw /
# mount -avt nonfs,noproc,nosmbfs
# cd /etc
# vi passwd
# vi shadow
If the second data field in /etc/passwd is "x" for every username, your system uses shadow passwords, and you must edit /etc/shadow. To disable the root password, edit the second data field in the password file so that it becomes empty. Now the system can be rebooted and you can log on as root without a password.
Assuming your original root partition is /dev/hda2, boot from the disk
# mkdir fixit
# mount /dev/hda3 fixit
# cd fixit/etc
# vi shadow
# vi passwd

If the second data field in /etc/passwd is "x" for every username, your system uses shadow passwords, and you must edit /etc/shadow. To disable the root password, edit the second data field in the password file so that it becomes empty. Now the system can be rebooted and you can log on as root without a password.
Console getting fluded with messages during Error messages on the console screen

By default /etc/syslog.conf is set to overwrite the console screen. Edit the last (or appropriate) part of this file to change this behaviour.

You may also run "dmesg -n1" to quiet on-screen error messages.

Oh no, I cannot boot the system

No problem, even if you didn't bother to make a boot disk during install. If lilo is broken, grab the boot disk from the Debian installation set and boot your system from it. At the boot prompt, assuming the root partition of your Linux installation is on /dev/hda12 and you want runlevel 3, enter:
boot: rescue root=/dev/hda2 3

Then you are booted into an almost fully functional system using the kernel on the floppy. There may be minor glitches due to lack of kernel features or modules.

Can't telnet as 'root' into the system from outside?

You can login as root from the local console, also can do a "su", but not telnet as 'root'? This is because this is the default behaviour for security reasons. If you can, use ssh and scp instead of telnet and ftp. If you cannot or think that your system is secure, add the necessary number of pseudo terminals in /etc/securetty. You may also face this problem while logging from xterms locally.

ttyp0, ttyp1, ...., ttypa, ... (add one in each line)

My PC doesn't power-off on shutting down?

Well, you are not a lone user coming to this problem. Make sure of all these things first-

How do I add have my own file get executed during the boot sequence?

Create the file in /etc/init.d/, give executable permissions and run "update-rc.d" with appropriate arguments to create the links from various run levels.

How do configure (add or delete) start-up services on debian?

Use "rcconf" and unselect or deselect your choices.


[HOME] Last Updated: Apr' 2002
Any comments to the author?