1 / 52

Chapter 7

Chapter 7. Linux Services & Configuration. Learning Outcomes. Define function of root user Web – Based Administration tools in Linux System Linux configuration file and Log files Removable Media on a GNOME Desktop Removable Media on a KDE Desktop

yen
Download Presentation

Chapter 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 7 Linux Services & Configuration

  2. Learning Outcomes • Define function of root user • Web – Based Administration tools in Linux System • Linux configuration file and Log files • Removable Media on a GNOME Desktop • Removable Media on a KDE Desktop • Commands to view the partitions that are currently set up on the hard disk:

  3. Root User • Root user is called “super user” because it has power far beyond those of mortal user. • As root, you can access files and change the system in way other user cannot. • If you want to install new software or tweak your system, you should log on as user.

  4. Root User • You have to become root if you want to do anything that requires a high privilege level (e.g. administering your system). • Normally we log in as a regular user. But if you want a privilege of a super user, use the following command to become root: • The shell then prompts you for the root password. Type the password and press enter $su -

  5. Root User • But in some distribution like Knoppix, password is not required. • After you type su – and press enter, you will become root. Why? • In Ubuntu, you do not get to setup a root user when you install Ubuntu. • Instead of becoming root by using su – command, you can also type sudo followed by the command that you want to run as a root.

  6. Root User • Example: $ su - Password: ****** # • As you can see, when you become a root, the $ sign eventually become #. • This is one of the way you can distinguish between regular user and root

  7. Root User • You can also use the su command to become a user other than root. This is useful for troubleshooting a problem that is being experienced by a particular user, but not by others on the computer (such as an inability to print or send e-mail). • For example, to have the permissions of a user named idzwan, you’d type the following: $ su - idzwan

  8. Root User • Even if you were root user before you typed this command, afterward you would have only the permissions to open files and run programs that are available to idzwan. • As root user, however, after you type the su command to become another user, you don’t need a password to continue. • If you type that command as a regular user, you must type the new user’s password.

  9. Web-Based Administration Tools • Web-based administration tools are available with many open source projects to make those projects more accessible to casual users. • Projects such as Samba and CUPS come with their own Web administration tools. • Webminis a general-purpose tool for administering a variety of Linux system services from your Web browser. • The advantages of Web-based administration tools are that you can operate them from a familiar interface (your Web browser) and you can access them remotely. • Some Linux distributions come with their own set of graphical administration tools (such as SUSE’s YaST or Red Hat’s system-config tools). • You should generally use those instead of any Web-based interface that comes with a project because a distribution’s own tools are usually better integrated with its tools for starting and stopping services.

  10. Web-Based Administration Tools cont.. Open Source Projects Offering Web Administration • Several major open source projects come with Web-based interfaces for configuring those projects. • Regardless of which Linux you are using, you can use your Web browser to configure the following projects: 1.Samba 2.CUPS 3.Squirrelmail 4. mailman

  11. Web-Based Administration Tools cont.. 1. Samba • Free software, developed by Australian Andrew Tridgell. • Run on most unix and Unix-like system. • Released under GNUGeneral Public Licence. • The name Samba comes from SMB(Server Message Block).

  12. Web-Based Administration Tools cont.. Features of Samba • Allow file and print sharing between computers running Windows and computers running Unix. • Set up network shares for chosen Unix directories. • Unix users can either mount the shares directly as part of their files structure using the smbmountcommand. • Each directory can have different access privileges overlaid on top of the normal Unix file protections.

  13. Web-Based Administration Tools cont.. Advantages of Samba • Portable across multiple platforms. • Allow for easier networking of Windows workstations to computers running other platforms.

  14. Web-Based Administration Tools cont.. Disadvantages of Samba • Maintaining compatibility with Microsoft’s implementation • Threat of legal action against commercial users of Samba.

  15. Web-Based Administration Tools cont.. 2. CUPS • A short of the Common Unix Printing System that allows a computer to add as print server. • The computer running CUPS is a host that can accept print jobs from clients computer, process them and send them to the appropriate printer. • CUPS administration tool to manage printers and classes and do a variety of administration tasks. • Consists of a print spooler and scheduler. • Use the Internet Printing Protocol (IPP) as the basis for managing print jobs and queues • License under GNU General Public License and GNU Lesser General Public License version 2.

  16. Web-Based Administration Tools cont.. Features of CUPS • Filter System • Can process a variety of data format on the print server • Converts the print job data into the final language of format of the printer via a series of filters • Uses MIME types for identifying file formats. • Scheduler • The CUPS scheduler implement IPP over HTTP/1.1 • Provides a web-based interface for managing print jobs, the configuration of the server, and for documentation about CUPS itself

  17. Web-Based Administration Tools cont.. Advantages of CUPS • Already has commands for submitting, viewing and manipulating the job queue • You can easily set up a pool which will allocate jobs to slots as they become available • Can be used on/by remote machines easily • Adding extra job slots just means adding a new printer • Jobs can easily be paused or delayed • Can submit from Windows using Samba

  18. Web-Based Administration Tools cont.. Disadvantages of CUPS • Has no way of adding job interdependence. • Probably doesn’t scale to several thousand processors well • You could end up with a lot of scrap paper if you use the wrong queue.

  19. Web-Based Administration Tools cont.. 3. SquirrelMail • SquirrelMail is a web-based email application started by Nathan and Luke Ehresman and written in the PHP scripting language. • It can be installed on almost all web servers as long as PHP is present and the web server has access to an IMAP and SMTP server. • SquirrelMail outputs valid HTML 4.0 for its presentation, making it compatible with a majority of current web browsers. • SquirrelMail uses a plugin architecture to accommodate additional features around the core application, and over 200 plugins are available on the SquirrelMail website. • Licensed under the GNU General Public License. • It is currently available in over 50 languages. • SquirrelMail is included in the repositories of many major GNU/Linux distributions • It is independently downloaded.

  20. Web-Based Administration Tools cont.. Features of SquirrelMail • A templating system • A RPC interface for use by other applications as well as AJAX-enabled SquirrelMail template sets (skins) • SquirrelMail has all the functionality you would want from an email client, including strong MIME support, address books, and folder manipulation. Faster login times due to improved message header caching • Security enhancements, such as HTTP Only cookies • Improved usability/accessibility.

  21. Web-Based Administration Tools cont.. Advantages of SquirrelMail • Support for text web browsers. • No JavaScript support required. • Easy integration into an already existing site. • Advanced skinning support.

  22. Web-Based Administration Tools cont.. Disadvantages of SquirrelMail • A separate web server must be set up. • Moderate configuration required. • Low error control and tracing possibilities. • IMAP (Internet Message Access Protocol) must be enabled.

  23. Web-Based Administration Tools cont.. 4. Mailman • GNU Mailman is a computer software application from the GNU project for managing electronic mailing lists. • Mailman is coded primarily in Python and currently maintained by Barry Warsaw. • Mailman is free software, distributed under the GNU General Public License.

  24. Web-Based Administration Tools cont.. Features of Mailman • A Web browser interface for list administration, archiving of messages, spam filtering. • A customizable home page for each mailing list. • Integrated bounce detection and automatic handling of bouncing addresses. • Integrated spam filters • Multiple list owners and moderators. • Support for virtual domains.

  25. Web-Based Administration Tools cont.. • Mailman also integrates most things people want to do with mailing lists, including archiving, mail-to-news gateways, integrated bounce handling, spam prevention, email-based admin commands, direct SMTP delivery (with fast bulk mailing), support for virtual domains, and more. • Mailman runs on most Unix-like systems, is compatible with most web servers and browsers, and most SMTP servers. • Mailman requires Python version 1.5 or newer. Python is a free object-oriented scripting language. A few files are written in C for security purposes.

  26. Web-Based Administration Tools cont.. Advantages of Mailman • Users email addresses, even the entire list, can be set as private. • Granular(rough) controlover who can post. • Ability to easily suspend posts to the entire list on a temporary basis. • Users are free to subscribe and unsubscribe to a list at will. • Automatic removal of stale email addresses.

  27. Web-Based Administration Tools cont.. Disadvantages of Mailman • Requires technical personnel establish and maintain list. • Can reveal everyone's email address included in the list. • No facility for message moderation.

  28. Web-Based Administration Tools cont..

  29. Linux Configuration File Describe the contents of the following configuration files: 1) $HOME. 2) /etc 3) /etc/cron* 4) /etc/cups 5) /etc/default 6) /etc/init.d • 7) /etc/mail • 8) /etc/pcmcia • 9) /etc/ppp • 10) /etc/skel • 11) /etc/sysconfig

  30. Linux Configuration File 1) $HOME • All users store information in their home directories that directs how their login accounts behave. • Most configuration files in $HOME begin with a dot (.), so they don’t appear in a user’s directory when you use a standard ls command (you need to type ls-a to see them). • There are dot files that define how each user’s shell behaves, the desktop look-and-feel, and options used with your text editor. • There are even files such as .ssh/* and .rhosts that configure network permissions for each user. (To see the name of your home directory, type echo $HOME from a shell.)

  31. Linux Configuration File 2) /etc This directory contains most of the basic Linux system-configuration files 3) /etc/cron* • Contain time schedule for the execution of recurring tasks according to a combination of the time, day of the month, month, day of the week, and week. • What is cron? Cron is the name of program that enables Linux/UNIX users to execute commands or scripts (groups of commands) automatically at a specified time/date.

  32. Linux Configuration File 4) /etc/cups • Contains files used to configure the CUPS printing service 5) /etc/default • Contains files that set default values for various utilities. For example, the file for the useradd command defines the default group number, home directory, password expiration date, shell, and skeleton directory (/etc/skel) that are used when creating a new user account.

  33. Linux Configuration File 6) /etc/init.d • Contains the initialization and termination scripts for changing init states. 7) /etc/mail • Contains files used to configure your sendmail mail service. 8) /etc/pcmcia • Contains configuration files that allow you to have a variety of PCMCIA (Personal Computer Memory Card International Association ) cards configured for your computer. (PCMCIA slots are those openings on your laptop that enable you to have credit card–sized cards attached to your computer. You can attach devices such as modems and external CD-ROMs.)

  34. Linux Configuration File 9) /etc/ppp • Contains several configuration files used to set up Point-to-Point Protocol (PPP) so that you can have your computer dial out to the Internet. 10) /etc/skel • Any files contained in this directory are automatically copied to a user’s home directory when that user is added to the system. By default, most of these files are dot (.) files, such as .kde (a directory for setting KDE desktop defaults) and .bashrc (for setting default values used with the bash shell).

  35. Linux Configuration File 11) /etc/sysconfig • Contains important system configuration files that are created and maintained by various services (including iptables, samba, and most networking services). These files are critical for Linux distributions that use GUI administration tools but are not used on other Linux systems at all.

  36. Linux Configuration File Utilities for logging error and debugging messages • The main utilities for logging error and debugging messages for Linux are the syslogd and klogd daemons. • General system logging is done by syslogd. Logging that is specific to kernel activity is done by klogd. • Logging is done according to information in the /etc/syslog.conf file. Messages are typically directed to log files that are usually in the /var/log directory. • What is daemons? A process that runs in the background and performs a specified operation at predefined times or in response to certain events. The term daemon is a UNIX term, though many other operating systems provide support for daemons, though they're sometimes called other names. Windows, for example, refers to daemons as System Agents and services. For example, lpd is a daemon that controls the flow of print jobs to a printer.

  37. Removable Media on a GNOME Desktop • The GNOME desktop offers the Removable Drives and Media Preferences window to define what happens when you attach removable devices or insert removable media into the computer. • The descriptions in this section are based on GNOME 2.16. • From a GNOME desktop, select System➪Preferences➪Removable Drives and Media to see how your system is configured to handle removable hardware and media.

  38. Removable Media on a GNOME Desktop

  39. Removable Media on a GNOME Desktop • The following settings are available from the Removable Drives and Media Preferences window on the Storage tab. • These settings relate to how removable media are handled when they are inserted or plugged in: 1) Mount removable drives when hot-plugged When a removable drive (such as a USB hard drive) is plugged into a running system, that drive is automatically mounted in a subdirectory of /media. 2) Mount removable media when inserted When a removable medium (such as a CD or DVD) is inserted into a drive, the medium is automatically mounted to a subdirectory of /media that is based on the medium’s volume ID.

  40. Removable Media on a GNOME Desktop 3) Browse removable media when inserted After a removable medium is inserted and mounted, a Nautilus window opens to display the contents of that medium. 4) Auto-run programs on new drives and media After a removable medium is inserted and mounted, auto-run any program in the top-level directory of the medium that is named .autorun, autorun, or autorun.sh. 5) Auto-open files on new drives and media After a removable medium is inserted and mounted, open any file in the top-level directory of the medium that is named .autoopen or autoopen. 6) Burn a CD or DVD when a blank disc is inserted When a blank CD or DVD is inserted, you are asked if you want to make an audio CD or data CD. Either selection opens a CD/DVD Creator Nautilus window for you to drag-and-drop files on. Click Write to Disc when you are done, and the files are burned to that medium.

  41. Removable Media on a KDE Desktop • When you insert a removable medium (CD or DVD) or plug in a removable device (digital camera or USB flash drive) from a KDE desktop in SUSE, a window opens to let you choose the type of action to take on it. • If you want to add a different action, or change an existing action, click the Configure button.

  42. Removable Media on a KDE Desktop

  43. Removable Media on a KDE Desktop • From the KDE Control Module, select the media type you want to change (in this case, Mounted Removable Medium). • Click Add, and then select the type of action you would like to add as an option when that type of media is detected. • If you have installed the Linux kernel source code, source code files for available drivers are stored in subdirectories of the /usr/src/linux*/drivers directory. • You can find information about these drivers in a couple of ways:

  44. Removable Media on a KDE Desktop 1) make xconfig • With /usr/src/linux* as your current directory, type make xconfigfrom a Terminal window on the desktop. Select the category of module you want and then click Help next to the driver that interests you. The help information that appears includes a description of the driver. • (If your system is missing graphical libraries needed to run make xconfig, try make menuconfig instead.) 2) Documentation • The /usr/src/linux*/Documentation directory contains lots of plain-text files describing different aspects of the kernel and related drivers.

  45. Removable Media on a KDE Desktop 3) After modules have been built, they are installed in the /lib/modules/ subdirectories. 4) The name of the directory is based on the release number of the kernel that the modules were compiled for. 5)Modules that are in that directory can then be loaded and unloaded as they are needed.

  46. Removable Media on a KDE Desktop 6) Listing Loaded Modules • To see which modules are currently loaded into the running kernel on your computer, use the lsmod command. Here’s an example:

  47. Removable Media on a KDE Desktop 7) This output shows a variety of modules that have been loaded on a Linux system, including several to support the ALSA sound system, some of which provide OSS compatibility (snd_seq_oss). 8) To find information about any of the loaded modules, use the modinfo command. For example, you could type the following:

  48. Commands to view the partitions that are currently set up on the hard disk: 1) fdisk • There are many usage of the fdisk command. Here are some examples. • fdisk /dev/hda (for the first IDE disk) • fdisk /dev/sdc (for the third SCSI disk) • fdisk /dev/eda (for the first PS/2 ESDI drive) • fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)

  49. Commands to view the partitions that are currently set up on the hard disk: 2) To see what partitions are currently set up on partitions that the Linux kernel has detected, use thefdisk –l command

  50. Commands to view the partitions that are currently set up on the hard disk: • This output shows the disk partitioning for a computer capable of running both Linux and Microsoft Windows. • You can see that the Linux partition on /dev/sda3 has most of the space available for data. • There is a Windows partition (/dev/sda1) and a Linux swap partition (/dev/sda5). • There is also a small /boot partition (46MB) on /dev/sda2. In this case, the root partition for Linux has 3.3GB of disk space and resides on /dev/sda3. Fdisk -l uses partition information found in /proc/partitions unless explicitly given on the command line.

More Related