12
System Administration

System administration

Embed Size (px)

Citation preview

Page 1: System administration

System Administration

Page 2: System administration

Root Login

Root is a specific user in linux. It has a full administrative privilege over the system and its resources. In linux, user needs root privilage for specific task or system configuration. It is not good practice to root logon for normal task in linux. It may even damage your system while the command use. So root is also known as a super user.

Page 3: System administration

Configuration of hardware with kudzu

Kudzu is a hardware probing program (written by Red Hat Linux) which relies on a library of hardware device information. When the computer boots, kudzu detects changes in the running system's hardware configuration, if any, and activates the newly-detected hardware (or removal of hardware).

Page 4: System administration

Kudzu in detailThe kudzu program is a hardware auto detection and configuration tool that runs automatically at boot time. If you like, you can also start kudzu while Red Hat Linux is running. In either case, here is what kudzu does:It checks the hardware connected to your computer.It compares the hardware it finds to the database of hardware information stored in the /etc/sysconfig/hwconf file.It prompts you to change your system configuration, based on new or removed hardware that was detected.The following is a list of hardware that kudzu can detect (according to the kudzu README file), followed by a description of what kudzu does to configure the device. Other devices may be detected as well (such as USB devices).Network devices — Adds an Ethernet interface alias (eth0, eth1, etc.)Sound card — Runs the sndconfig command to configure and test the sound card.Mouse — Links the new mouse device to /dev/mouseModem — Links the new modem device to /dev/modem.CD-ROM — Links the CD-ROM device to /dev/cdrom.Scanner — Links the new scanner device to /dev/scanner.Keyboard — Runs the kbdconfig command to reconfigure the keyboard. Also, if you are using a serial console, it makes sure /etc/inittab and /etc/securetty are configured to be used by a serial console.The following is a list of actions kudzu takes when a device is removed:Network — Removes the alias for the Ethernet interface (eth0, eth1, etc.).Mouse — Removes the link to /dev/mouse.Modem — Removes the link to /dev/modem.CD-ROM — Removes the link to /dev/cdrom.Scanner — Removes the link to /dev/scanner.

Page 5: System administration

System Management

Page 6: System administration

System Management

- Use the who command to see all the currently logged in users.

[root@rhel4 ~]# who paul pts/1 Feb 14 18:21 (192.168.1.45)sandra pts/2 Feb 14 18:11 (192.168.1.42) jack pts/3 Feb 14 12:01 (192.168.1.33)

Page 7: System administration

System Management

- The last command is used to check the user who logon at the last time.

[root@rhel4a ~]# last | head

The last command can also be used to get a list of last reboots.[paul@rekkie ~]$ last reboot

You can use the tail -f command to look at the last lines of a log file. The -f option will dynamically display lines that are appended to the log.paul@ubu1010:~$ tail -f /var/log

Page 8: System administration

Memory Management

- Displaying /proc/meminfo will tell you a lot about the memory on your Linux computer.

paul@ubu1010:~$ cat /proc/meminfoMemTotal: 3830176 kB MemFree: 244060 kB Buffers: 41020 kB Cached: 2035292 kB SwapCached: 9892 kB

Page 9: System administration

Memory Management

- The top tool is often used to look at processes consuming most of the cpu, but it also displays memory information

Below a screenshot of top on the same ubu1010 from above.[root@hostmaster]# toptop - 10:44:34 up 16 days, 9:56, 6 users, load average: 0.13, 0.09, 0.12 Tasks: 166 total, 1 running, 165 sleeping, 0 stopped, 0 zombie Cpu(s): 5.1%us, 4.6%sy, 0.6%ni, 88.7%id, 0.8%wa, 0.0%hi, 0.3%si, 0.0%st Mem: 3830176k total, 3613720k used, 216456k free, 45452k buffers Swap: 6384636k total, 84988k used, 6299648k free, 2050948k cached[root@hostmaster]# free

- You can find information about swap usage using vmstat.paul@ubu1010:~$ vmstat

Page 10: System administration

Monitoring System Performence

Monitoring means obtaining information about the utilization of memory, CPU power, bandwidth and storage. You should start monitoring your system as soon as possible, to be able to create a baseline. Make sure that you get to know your system. The baseline is important, it allows you to see a steady growth in CPU utilization or a steady decline in free disk space.

Page 11: System administration

Monitoring System Performence

- Use the following commands to check the process and Harddisk information:[root@hostmaster]# ps- Displays the running process in the system.[root@hostmaster]# df –h- Displays the free space in storage devices.[root@hostmaster]# du –sh- Displays the used space of hard disk in human readable form.[root@hostmaster]# fdisk -l- Displays the list of partition[root@hostmaster]# lspci- Displays the list of pci devices[root@hostmaster]# lsusb- Displays the list of usb devices.

Page 12: System administration

Monitoring System Performence

- The iostat tool can display disk and cpu statistics.

[paul@RHELv4u3 ~]$ iostat –d[paul@RHELv4u3 ~]$ iostat -c -d for disk statistics-c for cpu statistics

- Use iptraf for a colourful display of ip traffic over the network cards.[root@centos65 ~]# iptraf [root@centos65 ~]# iptraf -i eth0

- Try the command nmon and ntop