How to determine which sevices are enabled at boot time in linux
->
How do I find out which services are enabled at Boot under Ubuntu/CentOS/RHEL/Fedora Linux? How can I disable a service which is not needed or I dont want to run every time the linux machine starts?
Open terminal and login as root user.
Type the following command to list all services which are enabled at boot:
#chkconfig --list | grep $(runlevel | awk '{ print $2}'):on
Sample output:
acpid 0:off 1:off 2:off 3:on 4:on 5:on 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off cpuspeed 0:off 1:on 2:on 3:on 4:on 5:on 6:off crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off dkms_autoinstaller 0:off 1:off 2:on 3:on 4:on 5:on 6:off haldaemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off hidd 0:off 1:off 2:on 3:on 4:on 5:on 6:off irqbalance 0:off 1:off 2:on 3:on 4:on 5:on 6:off kudzu 0:off 1:off 2:off 3:on 4:on 5:on 6:off lighttpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off lm_sensors 0:off 1:off 2:on 3:on 4:on 5:on 6:off lvm2-monitor 0:off 1:on 2:on 3:on 4:on 5:on 6:off mcstrans 0:off 1:off 2:on 3:on 4:on 5:on 6:off mdmonitor 0:off 1:off 2:on 3:on 4:on 5:on 6:off messagebus 0:off 1:off 2:off 3:on 4:on 5:on 6:off microcode_ctl 0:off 1:off 2:on 3:on 4:on 5:on 6:off mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off named 0:off 1:off 2:on 3:on 4:on 5:on 6:off netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off pcscd 0:off 1:off 2:on 3:on 4:on 5:on 6:off psacct 0:off 1:off 2:on 3:on 4:on 5:on 6:off readahead_early 0:off 1:off 2:on 3:on 4:on 5:on 6:off restorecond 0:off 1:off 2:on 3:on 4:on 5:on 6:off rhnsd 0:off 1:off 2:on 3:on 4:on 5:on 6:off rpcgssd 0:off 1:off 2:off 3:on 4:on 5:on 6:off rpcidmapd 0:off 1:off 2:off 3:on 4:on 5:on 6:off sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off setroubleshoot 0:off 1:off 2:off 3:on 4:on 5:on 6:off smartd 0:off 1:off 2:on 3:on 4:on 5:on 6:off snmpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off xfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off yum-updatesd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
The first column of above output is the name of a service which is currently enabled at boot. You need to review each service.
Task: Disable services
To stop service, enter:
# service {service-name} stop # service vmware stop
To disable service, enter:
# chkconfig {service-name} off # chkconfig vmware off
You may also use ntsysv command to manage all services.
A note about outdated insecure service
All of the following services must be disabled to improve server security:
- Inetd and Xinetd (inetd xinetd) - Use direct services configured via SysV and daemons.
- Telnet (telnet-server) - Use ssh
- Rlogin, Rsh, and Rcp ( rsh-server ) - Use ssh and scp.
- NIS (ypserv) : Use OpenLDAP or Fedora directory server.
- TFTP (tftp-server) : Use SFTP or SSH.
To delete all of the service enter:
# yum erase inetd xinetd ypserv tftp-server telnet-server rsh-serve
Make a USB Boot CD for Ubuntu 9.04
->
The following tutorial explains how to create a USB Boot CD that can be used to boot a Ubuntu 9.04 USB flash drive on computers with a BIOS that does not natively support booting from USB. The boot CD contains a grub bootloader that loads the initrd and vmlinuz kernel from the CD and then proceeds to locate the filesystem on the USB drive. Because the USB driver modules are preloaded from the initrd on the CD, the compressed filesystem can then be detected and loaded from the USB device.
USB Boot CD for Ubuntu 9.04 creation essentials
- PC with a BIOS that does not support booting from USB
- Working CD Drive and USB Port
- Ubuntu 9.04 Live CD
- USB flash drive with Ubuntu 9.04 preinstalled
- Insert the Ubuntu 9.04 Live CD and restart your computer, booting from the CD
- Open a Terminal and Type mkdir -p ubcd/boot/grub
- Type cp /usr/lib/grub/i386-pc/stage2_eltorito ubcd/boot/grub
- Type gedit ubcd/boot/grub/menu.lst
Add the following information to your menu.lst file and click save:title Run Ubuntu 9.04 from USB DISK
root (cd)
kernel /boot/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper noprompt cdrom-detect/try-usb=true persistent
initrd /boot/initrd.gz
boot - Type cp /cdrom/casper/initrd.gz ~/ubcd/boot
- Type cp /cdrom/casper/vmlinuz ~/ubcd/boot
- Type sudo gedit /etc/initramfs-tools/modules
Add the following lines to the modules file and click save:usbcore usb-storage uhci_hcd ohci_hcd ehci_hcd sd_mod scsi_mod
- Type sudo gedit /etc/initramfs-tools/initramfs.conf
Add the following line to the bottom of the file and click save:WAIT=8
- Type sudo mkinitramfs -o ubcd/boot/initrd.gz 2.6.2*
- Type mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o usbcd.iso ubcd
- Burn the usbcd.iso to a CD
Replacing 2.6.2* with your actual kernel version.
Type uname -r to find your kernel version. I.E. initrd.gz 2.6.28-11-generic
Make a USB Boot CD for Linux Mint
This USB Boot CD can be used to boot Linux Mint 6 from a USB flash drive on computers with a BIOS that does not support booting from USB. Linux Mint is a remix based on Ubuntu. The USB Boot CD uses a grub bootloader to launch the vmlinuz kernel and initrd from the CD, loading the necessary USB drivers, and then proceeds to locate and extract the compressed filesystem from the flash drive.
Please Note: This USB Boot CD should work on most systems. However, it should be noted that the USB Boot CD may not work on really old computers with only USB 1.0 hardware support.
Can be used to boot flash drives created using the Linux Mint USB Install via CD or Linux Mint USB Install via Windows
USB Boot CD for Linux Mint 6 creation essentials:
- PC with a BIOS that does not support booting from USB
- Linux Mint 6 Live CD
- Working CD Drive and USB Port
- USB flash drive with Linux Mint 6 preinstalled
Creating a CD to Boot Linux Mint 6 from USB
The following process will enable you to create a Boot CD that can be used to Boot Linux Mint 6 from a USB Flash Drive on systems that do not natively support booting from USB.
- Insert the Linux Mint 6 Live CD and restart, booting from the CD
- Open a terminal and type mkdir -p usbcdm/boot/grub
- Type cp /usr/lib/grub/i386-pc/stage2_eltorito usbcdm/boot/grub
- Type gedit usbcdm/boot/grub/menu.lst
- Add the following information to your menu.lst file and save it
title Run Linux Mint 6 from USB DISK root (cd) kernel /boot/vmlinuz file=/cdrom/preseed/mint.seed boot=casper noprompt cdrom-detect/try-usb=true persistent quiet splash initrd /boot/initrd.gz boot
- Type cp /cdrom/casper/initrd.gz ~/usbcdm/boot
- Type cp /cdrom/casper/vmlinuz ~/usbcdm/boot
- Type mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o usbcdmint.iso usbcdm
- Burn the usbcdmint.iso to a CD
Booting from the USB Boot CD for Linux Mint
- Shutdown your computer
- Insert the USB Boot CD and your Linux Mint flash drive
- Set your BIOS or Startup Menu to boot from CD
- Start your computer (booting from the CD)
The USB Boot CD should load the necessary USB drivers, detect the filesystem.squashfs on your flash drive, and then proceed to boot Linux Mint 6 from the flash drive.