Home » , , » Linux Administration

Linux Administration

Written By Sajib Barua on Sunday, August 19, 2012 | 9:34 AM

Introducing Basic System Administration
System administration, or sysadmin, refers to whatever has to be done to keep a computer system up and running. The system administrator (the sysadmin) is whoever is in charge of taking care of these tasks.
If you’re running Linux at home or in a small office, you’re most likely the system administrator for your systems. Or maybe you’re the system administrator for an entire LAN full of Linux systems. Regardless of your position or title, this chapter will introduce you to basic system administration procedures and show you how to perform some common tasks.
Taking Stock of System Administration Tasks
So what are system administration tasks? An off-the-cuff reply is anything you have to do to keep the system running well. More accurately, though, a system administrator’s duties include
  • Adding and removing user accounts: You have to add new user accounts and remove unnecessary user accounts. If a user forgets the password, you have to change the password.
  • Managing the printing system: You have to turn the print queue on or off, check the print queue’s status, and delete print jobs if necessary.
  • Installing, configuring, and upgrading the operating system and various utilities: You have to install or upgrade parts of the Linux operating system and other software that are part of the operating system.
  • Installing new software: You have to install software that comes in various package formats, such as RPM or DEB. You also have to download and unpack software that comes in source-code form — and then build executable programs from the source code.
  • Managing hardware: Sometimes, you have to add new hardware and install drivers so the devices work properly.
  • Making backups: You have to back up files, to a DVD drive, a USB memory stick, an external hard drive, or on tape.
  • Mounting and unmounting file systems: When you want to access the files on a CD-ROM, for example, you have to mount that CD-ROM’s file system on one of the directories in your Linux file system. You may also have to mount floppy disks, in both Linux format and DOS format.
  • Automating tasks: You have to schedule Linux tasks to take place automatically (at specific times) or periodically (at regular intervals).
  • Monitoring the system’s performance: You may want to keep an eye on system performance to see where the processor is spending most of its time and to see the amount of free and used memory in the system.
  • Starting and shutting down the system: Although starting the system typically involves nothing more than powering up the PC, you do have to take some care when you shut down your Linux system. If your system is set up for a graphical login screen, you can perform the shutdown operation by choosing a menu item from the login screen. Otherwise, use the shutdown command to stop all programs before turning off your PC’s power switch.
  • Monitoring network status: If you have a network presence (whether a LAN, a DSL line, or a cable modem connection), you may want to check the status of various network interfaces and make sure your network connection is up and running.
  • Setting up host and network security: You have to make sure that system files are protected and that your system can defend itself against attacks over the network.
  • Monitoring security: You have to keep an eye on any intrusions, usually by checking the log files.
That’s a long list of tasks! Not all these items are covered in this chapter, but the rest of this minibook describes most of these tasks. The focus in this chapter is on some of the basics, such as using the GUI tools, explaining how to become root (the superuser), describing the system configuration files, and showing you how to monitor system performance, manage devices, and set up periodic jobs.
Introducing Some GUI Sysadmin Tools
Each Linux distribution comes with GUI tools for performing system administration tasks. The GUI tools prompt you for input and then run the necessary Linux commands to perform the task. The following sections briefly introduce the GUI sysadmin tools in Debian, Fedora, Knoppix, SUSE, Ubuntu, and Xandros.
GUI sysadmin tools in Debian
Debian uses the GNOME desktop by default and provides some GUI tools for performing sysadmin tasks. These tools are available by choosing Applications»System Tools. Table 1-1 lists some common tasks and the menu choices you use to start the GUI tool that enables you to perform that task.

Table 1-1
Performing Sysadmin Tasks with GUI Tools in Debian
To Do This
Choose the Following from the Debian GNOME Desktop
Add or remove software Packages
ApplicationsSystem Tools➪Synaptic Package Manager
Change the date or time
Applications➪System Tools➪Time and Date
Change a password
Main Menu➪Settings➪Change Password
Configure a desktop
Applications➪Desktop Preferences
Configure a network
Applications➪Networking
Format a floppy
Applications➪System Tools➪Floppy Formatter
Manage printers
Applications➪System Tools➪Printers
Manage user accounts
Applications➪System Tools➪Users and Groups
Monitor system performance
Applications➪System Tools➪System Monitor
View system logs
Applications➪System Tools➪System Log
GUI sysadmin tools in Fedora
Fedora comes with a set of GUI system configuration tools that can ease the burden of performing typical sysadmin chores. Table 1-2 briefly summarizes the menu choices you use to start a GUI tool for a specific task.
Table 1-2
Starting GUI Sysadmin Tools in Fedora
To Configure or Manage This
Start GUI Tool by Choosing This
Date and time
System➪Administration➪Date & Time
Disks and DVD/CD-ROM
Applications➪System Tools➪Disk Utility
Display settings
System➪Preference➪Display
Firewall settings
System➪Administration➪Firewall
Internet connection
System➪Preferences➪Network Connectivity
Network
System➪Preferences➪Network Connectivity
Preferences such as desktop
and password
System➪Preferences
Printer
System➪Administration➪Printing
Software
System➪Administration➪Add/Remove Software
System performance
Applications➪System Tools➪System Monitor
User accounts
System➪Administration➪Users and Groups
GUI sysadmin tools in Knoppix
Knoppix is a Live CD distribution that you can use either to try out Linux or to fix problems in an existing Linux system. As such, Knoppix comes with several GUI tools that you can use for system administration tasks. Table 1-3 summarizes some of the GUI tools in Knoppix.
Table 1-3
Using GUI tools for Sysadmin Tasks in Knoppix
To Do This
Choose This from the Knoppix GUI Desktop
Configure a desktop
Main Menu➪Preferences➪Appearances
Main Menu➪Preferences➪Openbook Configuration Manager
Configure KDE
Main Menu➪System Tools➪Configuration Editor
Configure a network
Main Menu➪Preferences➪ISDN Connection
Configure a printer
Main Menu➪Preferences➪KNOPPIX➪Printer Configuration
Manage disk partitions (for troubleshooting existing Linux installations)
Main Menu➪Preferences➪GParted
Change the root password
Main Menu➪Preferences➪KNOPPIX➪Set password for root
See disk usage
Main Menu➪System Tools➪Disk usage analyzer
Configure software
Main Menu➪Preferences➪KNOPPIX➪Synaptic Package Manager
View log files
Main Menu➪System Tools➪Log file viewer
GUI sysadmin tools in SUSE
In SUSE, from the main menu, choose YaST to start your system administration tasks in the YaST Control Center. Figure 1-1 shows the YaST Control Center window.
YaST Control Center is your starting point for many sysadmin tasks in SUSE. Figure 1-1: YaST Control Center is your starting point for many sysadmin tasks in SUSE.
The left side of the YaST Control Center shows icons for the categories of tasks you can perform. The right side shows icons for specific tasks in the currently selected category. When you click an icon on the right side of the YaST Control Center, a new YaST window appears and enables you to perform that task.
Table 1-4 summarizes the tasks for each of the category icons on the left side of the YaST Control Center. As you can see from the entries in the second column of Table 1-4, YaST Control Center is truly one-stop shopping for all of your sysadmin chores.

Table 1-4
Tasks by Category in the YaST Control Center
This Category
Enables You to Configure or Manage the Following
Software
Online Update, Installation Source, Installation in Xen Environment, Installation into Directory, Media Check, Patch CD Update, Software Management, System Update
Hardware
Bluetooth, CD-ROM Drives, Disk Controller, Graphics Card and Monitor, Hardware Information, IDE DMA Mode, Infrared Device, Joystick, Keyboard Layout, Mouse Model, Printer, Scanner, Sound, TV Card
System
/etc/sysconfig Editor, Boot Loader Configuration, Boot or Rescue Floppy, Date and Time, LVM, Language, PCI Device Drivers, Partitioner, Power Management, Powertweak, Profile Manager, System Backup, System Restoration, System Services (run level)
Network Devices
DSL, Fax, ISDN, Modem, Network Card, Phone Answering Machine
Network Services
DHCP Server, DNS Server, DNS Host and Name, HTTP Server, Host Names, Kerberos Client, LDAP Client, Mail Transfer Agent, NFS Client, NFS Server, NIS Client, NIS Server, NTP Client, Network Services (xinetd), Proxy, Remote Administration, Routing, SLP Browser, Samba Client, Samba Server, TFTP Server
Security and Users
Firewall, Group Management, Local Security, User  Management
Miscellaneous
Autoinstallation, Post a Support Query, Vendor Driver CD, View Start-up Log, View System Log

GUI sysadmin tools in Ubuntu
Ubuntu uses the GNOME desktop, and its menu organization is similar to that of Fedora’s GNOME desktop. You can find Ubuntu’s GUI system administration tools in the following menus: Applications»System Tools,
System»Administration, and System»Preferences. Table 1-5 lists the menu choices for starting some of the GUI tools.
Table 1-5
Starting GUI Sysadmin Tools in Ubuntu
To Configure or Manage This
Start GUI Tool by Choosing This
Date and time
System➪Administration➪Time and Date
Display settings
System➪Preferences➪Display
Hardware
System➪Administration➪Hardware Drivers
Internet connection
System➪Administration➪Network Tools
Network
System➪Administration➪Network Tools
Preferences such as desktop and default applications
System➪Preferences
Printer
System➪Administration➪Printing
Software
System➪Administration➪Software Sources Manager
System logs
Applications➪System Tools➪System Log
System performance
System➪Administration➪System Monitor
Updates
System➪Administration➪Ubuntu Update Manager
User accounts
System➪Administration➪Users and Groups

GUI sysadmin tools in Xandros

Xandros is designed to be a desktop operating system, and as such, you can access everything easily from the desktop. For most sysadmin tasks, you start at the Xandros Control Center — choose Main Menu➪Control Center to get there. (Figure 1-2 shows you what you find when you do get there.)

You can perform many sysadmin tasks from the Xandros Control Center Figure 1-2: You can perform many sysadmin tasks from the Xandros Control Center.

The left side of the window shows a tree menu of task categories. Click the plus sign next to a category to view the subcategories. When you click a specific task, the right side of the window displays the GUI through which you can perform that task.

For some tasks, such as mounting file systems or adding printers, you can open the Xandros File Manager as a system administrator by choosing Main Menu»Applications»System»Administrator Tools»Xandros File Manager (Administrator). You’re prompted for the root password. Figure 1-3 shows the Xandros File Manager window from which you can perform some sysadmin tasks.

For some sysadmin tasks, use the Xandros File ManagerFigure 1-3: For some sysadmin tasks, use the Xandros File Manager.

How to Become root

You have to log in as root to perform system administration tasks. The root user is the superuser and the only account with all the privileges needed to do anything in the system.

Common wisdom says you should not normally log in as root. When you’re root, you can easily delete all the files with one misstep — especially when you’re typing commands. For example, you type the command rm *.html to delete all files that have the .html extension. But what if you accidentally press the spacebar after the asterisk (*)? The shell takes the command to be rm * .html and — because * matches any filename — deletes everything in the current directory. Seems implausible until it happens to you!

Using the su - command

If you’re logged in as a normal user, how do you do any system administration chores? Well, you become root for the time being. If you’re working at a terminal window or console, type

su

Then enter the root password in response to the prompt. From this point, you’re root. Do whatever you have to do. To return to your usual self, type

exit

That’s it! It’s that easy.

By the way, Knoppix has a root user but doesn’t have a root password, so you can become root by simply typing su - at the shell prompt in a terminal window. Also, Ubuntu doesn’t have a root user. To perform any task that requires root privileges in Ubuntu, you must type sudo followed by the command and then provide your normal user password when prompted.

Becoming root for the GUI utilities

Most Linux distributions include GUI utilities to perform system administration chores. If you use any of these GUI utilities to perform a task that requires you to be root, the utility typically pops up a dialog box that prompts you for the root password, as shown in Figure 1-4 (except in Ubuntu, where the GUI tools prompt for your normal user password). Just type the password and press Enter. If you don’t want to use the utility, click Cancel.

Type the root password and press Enter to gain root privilegesFigure 1-4: Type the root password and press Enter to gain root privileges.

Recovering from a forgotten root password

To perform system administration tasks, you have to know the root password. What happens if you forget the root password? Not to worry. You can reset the root password by following these steps:

  1. Reboot the PC (select Reboot as you log out of the GUI screen) or power up as usual.

    As soon you see the graphical GRUB boot loader screen that shows the names of the operating systems, you can boot. If your system runs the LILO boot loader, press Ctrl+X, type linux single at the boot: prompt, and press Enter. Then proceed to Step 4. If you don’t see the graphical loader screen on reboot, it might not be installed (which can occasionally occur when choosing to install from a Live CD). If this is the case, it is recommended that you reinstall from the CD.

  2. If you have more than one operating system installed, use the arrow key to select Linux as your operating system and then press the A key.

    GRUB prompts you for commands to add to its default boot command.

  3. Press the spacebar, and then type single and press Enter.

    Linux starts as usual but runs in a single-user mode that doesn’t require you to log in. After Linux starts, you see the following command-line prompt similar to the following:
           sh-3.00#

  4. Type the passwd command to change the root password as follows:

    sh-3.00# passwd
    Changing password for user root.
    New password:

  5. Type the new root password that you want to use (it doesn’t appear on-screen) and then press Enter.

    Linux asks for the password again, like this:
    Retype new password:

  6. Type the password again and press Enter.

    If you enter the same password both times, the passwd command
    changes the root password.

  7. Now type reboot to reboot the PC.

    After Linux starts, it displays the familiar login screen. Now you can log in as root with the new password.

In SUSE Linux, in Step 3, type single init=/bin/sh (instead of single) and before proceeding to Step 4, at the command-line prompt, type mount / -n -0 remount,rw. Then perform Steps 4 through 6 to change the root password. After changing the password, type mount / -n -o remount,ro. Then continue to Step 7 and reboot the PC.

Make sure that your Linux PC is physically secure. As these steps show, anyone who can physically access your Linux PC can simply reboot, set a new root password, and do whatever he or she wants with the system. Another way to protect against resetting the password is to set a GRUB password, which causes GRUB to require a valid password before it boots Linux. Of course, you must then remember to enter the GRUB password every time you boot your system!

next Understanding How Linux Boots

Share this article :

0 comments:

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Linux - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger