debian gnu linux bible phần 3 pptx

68 246 0
debian gnu linux bible phần 3 pptx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

111 Chapter 5 ✦ Networking The route command also adds information to the table. Here are some examples of adding routes to the table: ✦ route add isphost ppp0 — Adds the route to the isphost host via the PPP interface, assuming that isp host is the PPP host ✦ route add -net 192.168.32.0 netmask 255.255.255.0 gw isphost — This command line adds the network 192.168.32.x to be gatewayed using the route to the PPP interface (preceding). ✦ route add -net 192.168.76.0 netmask 255.255.255.0 dev eth0 — This line adds a route to the network 192.168.76.x via the device eth0. You can find an entry similar to this one in most routing tables to let the local machine know its local network. The IP address and netmask will change base on the environmet. ✦ route add default gw toad-gw — Adds a default route (toad-gw) as a gateway. The device actually used for that route depends on how you can reach toad-gw (assuming the static route to toad-gw is set up already). These examples show how to add routes to the table. There are other command options that enable you to remove routes, restrict routes, and more. Look at the online documentation for complete details. Typically, there are machines dedicated to rout- ing for complex networks. In most cases with small networks, little routing is needed. Summary You should have an understanding of how data is transferred on a network, what constitutes a network, and the key components to setting up a network. This area alone is a career path for some individuals as they strive to master routers, gate- ways, and networks across the country. If you are looking for your own domain name, try these services: ✦ Network Solutions at www.networksolutions.com ✦ Register.Com at www.register.com The topics covered in this chapter may not be as in-depth as you need for your situ- ation, or they may not cover the specific questions you might have. You can look into the following helpful Web pages. They are geared specifically to the topic, and they try to explain how to perform that task. Keep in mind though that these Web sites don’t address any specific distribution of Linux. ✦ www.linuxdoc.org/HOWTO/Chroot-BIND-HOWTO.html ✦ www.linuxdoc.org/HOWTO/DNS-HOWTO.html ✦✦✦ 4710-0 ch05.F 4/10/01 11:21 AM Page 111 Setting Up for the Internet T he biggest concern for the average user is applying Linux as a workstation. The workstation enables a person to perform normal functions such as writing letters, sending e-mail, reading news, and browsing the Internet. This is true for both office environments as well as for home use. Those workstations in an office environment are generally less concerned with a connection to the Internet . This chap- ter covers the process of connecting to the Internet through a dial-up connection. There are other means of connecting, which typically involve the use of a network connection through a cable modem, ISDN router, or DSL router. Once a connection is made to the Internet, a whole new world of applications awaits. This chapter also explores those appli- cations associated with Internet use, some of which are spe- cific to intermittent connections with a server as found with dial-up use. You can use the other applications I describe whether you have a full-time connection or an intermittent dial-up connection to the Internet. Connecting to an ISP For those just getting started with Linux, establishing an Internet connection is the most important part of the setup. The thought of getting it to work may intimidate you, so take a deep breath and relax. There are two types of connection protocols: Point-to-Point Protocol (PPP) and Serial Line IP (SLIP). SLIP is a much less efficient protocol and is rarely used. Conversely, PPP has become the standard protocol for modem communication. Both protocols allow the transmission of IP over a telephone line. 6 6 CHAPTER ✦✦✦✦ In This Chapter Utilities for dial-up service Clients used over the Internet Receiving dial-up calls ✦✦✦✦ 4710-0 ch06.F 4/10/01 11:22 AM Page 113 114 Part I ✦ Getting Started When connecting to the Internet, you need an Internet Service Provider (ISP) that also has modems into which you can dial. These modems have all the information necessary for dialing in. Using wvdial to connect The default, and probably the easiest dial-up client to use, is the wvdial utility. It lives up to its name as the intelligent PPP dial-up client by automatically negotiating the connection with the Internet whenever you issue the command. When you install wvdial from the command, you are asked questions for configur- ing it. You need to know the phone number you dial to access the Internet Service Provider (ISP), the account name used for dialing in, and the password for the account. Follow these steps to configure wvdial: 1. When asked if you want to configure wvdial, answer Yes. 2. The next three questions ask for information about the dial-in account. The installation process assumes that you only have one account, and therefore asks the appropriate questions based on the one account. Add the telephone number. Don’t include any special characters (such as parentheses, hyphens, or slashes) except those needed to dial the ISP. If you must add a pause to the number, use a comma for a 3-second pause. You can also add any number codes to disable features with the telephone as recom- mended by the ISP and/or the telephone company. Then add the account login name. This is the name of the account that the ISP assigns you when you sign up. Some ISPs include a special character, such as a dollar sign, to help keep their systems secure. The ISP can help with this information. Finally, enter the password that you were set up with for the account. As you type the password, notice that you cannot see what you are typing. However, you can clearly see this information if you look at the configuration file. 3. You are then asked to confirm that the information is correct. Answer Yes to this question to continue. As the configuration finishes, the script polls the serial devices for a modem. The found modem is added to the configuration file. You should turn on any external modems before the script queries for a modem. You can find all the information you enter in the configuration file at /etc/ wvdial.conf . Now that wvdial is configured, you just need to issue the command from a root shell. Then you should see something resembling the following dialog: > WvDial: Internet dialer version 1.41 > Initializing modem. > Sending: ATZ ATZ 4710-0 ch06.F 4/10/01 11:22 AM Page 114 115 Chapter 6 ✦ Setting Up for the Internet OK > Sending: ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0 OK > Modem initialized. > Sending: ATDT 5551234 > Waiting for carrier. ATDT 5551234 CONNECT 115200 > Carrier detected. Waiting for prompt. Welcome to the ISP DIGITAL Network You are connected to: iq-ind-as007 on slot:11/mod:17 at 10:47pm ISP Login: > Looks like a login prompt. > Sending: myname myname Password: > Looks like a password prompt. > Sending: (password) PPP session from 209.43.51.117 to 198.70.144.213 beginning [7f][03]@![01][01][1f][01][04][05]\[02][06][7f][7f][7f][7f][05] [06]^[19][7f]0[07][02][08][02][11][04][05]\[13][03]~[7f]}#@!}!} “}}?}!}$}%\}”}&[7f][7f][7f][7f]}%}&^}9[7f]0}’}”}(}”}1}$}%\}3}#} ;a~ > PPP negotiation detected. > Starting pppd at Sun Oct 15 18:17:11 2000 If you press Ctrl+C, wvdial attempts to close the connection in a friendly fashion. Using diald to connect If you wish to connect to the Internet every time a request is made, then you want diald. Called dial on demand, diald functions in small offices and homes where a temporary dial-up connection is used without the need to manually connect. diald monitors the traffic and determines if a connection needs to be made for requests going outside of the local network. Once the connection is established, diald monitors the connection to determine if it should shut down the link due to inactivity. You need to change some settings for diald to work properly. The following script file, /etc/diald/connect, contains the settings that you need to change (specifi- cally, the ones in boldface). #!/bin/sh # Copyright (c) 1996, Eric Schenk. # Copyright (c) 1997, 1998 Philippe Troin <phil@fifi.org> for Debian GNU/Linux. # # $Id:$ # 4710-0 ch06.F 4/10/01 11:22 AM Page 115 116 Part I ✦ Getting Started # This script is intended to give an example of a connection script that # uses the “message” facility of diald to communicate progress through # the dialing process to a diald monitoring program such as dctrl or diald-top. # It also reports progress to the system logs. This can be useful if you # are seeing failed attempts to connect and you want to know when and why # they are failing. # # This script requires the use of chat-1.9 or greater for full # functionality. It should work with older versions of chat, # but it will not be able to report the reason for a connection failure. # Configuration parameters # When debugging a connection, set DEBUG to -v to increase chat’s # verbosity and to report on this script’s progress. # WARNING: THIS MIGHT CAUSE YOUR PASSWORD TO SHOW UP IN THE SYSTEM LOGS # DEBUG=-v # The initialization string for your modem MODEM_INIT=”ATZ&C1&D2%C0” # The phone number to dial PHONE_NUMBER=”5551212” # If the remote system calls you back, set to 1; otherwise leave to 0. CALLBACK=0 # If you authentify using PAP or CHAP (that is let pppd handle the # authentification, set this to 0. AUTHENTIFY=1 # The chat sequence to recognize that the remote system # is asking for your user name. USER_CHAT_SEQ=”name: name: name: name: name: name: name:” # The string to send in response to the request for your user name. USER_NAME=”USER” # The chat sequence to recongnize that the remote system # is asking for your password. PASSWD_CHAT_SEQ=”word:” # The string to send in response to the request for your password. PASSWORD=”PASSWORD” # The prompt the remote system will give once you are logged in # If you do not define this then the script will assume that # there is no command to be issued to start up the remote protocol. PROMPT=”annex:” # The command to issue to start up the remote protocol PROTOCOL_START=”ppp” 4710-0 ch06.F 4/10/01 11:22 AM Page 116 117 Chapter 6 ✦ Setting Up for the Internet # The string to wait for to see that the protocol on the remote # end started OK. If this is empty then no check will be performed. START_ACK=”Switching to PPP.” The first bolded text in the file refers to the command sequence used to initialize your modem. Every modem can use a different sequence, so you should refer to your modem’s manual for the specifics. The next bolded text is the phone number. Here you type the phone number for your ISP. Only use numbers unless you need a pause—in which case, you use a comma for a 3-second pause. The user chat sequence is the prompt you receive if a terminal is connected to the ISP. Often this is ogin:, but it may include other greeting information. The ISP should know this information. Next is the account name — the name given when you sign up with the ISP. Note that some ISPs add a character, such as a dollar sign, to the account name to increase security. The password chat sequence is like the user chat sequence. This appears at the prompt when ready for the password. Again, the ISP should know this information. Next, you enter the password for the dial-in account. There are no special secrets with this one. Finally, the prompt appears when you are logged in to the remote system. This con- firms to diald that the attempt succeeded and there were no errors. In addition to changing the etc/diald/connect file, you may need to look at and change other files including diald.conf and diald.options. You also need to perform the following steps to get diald up and working: 1. Make a symbolic link of /dev/modem to the /dev/ttySx that points to your modem. Here is an example of creating this link: ln -s /dev/modem /dev/ttyS1 This creates a link to the modem on COM1 (represented by /dev/ttyS1) to the device called modem. diald uses this device name in its configuration files. Doing this also enables you to change modem devices without having to remember to make changes to other configuration files. 2. Remove lines mentioned in /etc/init.d/diald. When you edit this file, look for the following: #Remove the following lines after configuration echo Please read /usr/share/doc/diald/README.Debian for help setting up exit 0 4710-0 ch06.F 4/10/01 11:22 AM Page 117 118 Part I ✦ Getting Started Remove these lines for diald to work properly. As it is, the exit 0 entry in the file assumes that you have not made the configuration changes needed to let diald connect to your ISP. 3. You can then start the diald service manually by inputting /etc/init.d/ diald start from a command line. When first installed, diald is added to the default run level so that it runs normally the next time you restart your system. However, it did not run normally the last time you started because the lines mentioned in Step 2 were still in the initialization script. From here on out, when someone wants to connect to a system, Web site, or machine outside of your local machine or network, diald makes those connections for you. This machine is now your gateway to the Internet. Web Browsers One of the most common reasons to dial into the Internet is to access the World Wide Web. To do this, you need a Web browser. There are several Web browsers available to you for Linux: ✦ Lynx — A text-only Web page viewer. This works great on virtual terminals in which graphics is a problem. You can follow links by browsing page after page. ✦ Netscape — This is a Linux port of the commonly known Windows version. The latest version includes Java, JavaScript, and other plug-in support. ✦ Mozilla — An Open Source Web browser project using the code released by Netscape. It is now the basis for the next generation of Netscape version 6. ✦ Opera — A commercial Web browser offering commonly available features ✦ Konqueror — A Web browser built for the latest K Desktop environment I cover these browsers in more detail in Chapter 7, although this should give you an idea of the types of browsers available. E-Mail Clients E-mail has become the most common form of written communication. Now, instead of sending out a paper memo to departments, a department head sends out the same memo in an electronic message. Likewise, pen-pals shoot notes back and forth at near light speed. 4710-0 ch06.F 4/10/01 11:22 AM Page 118 119 Chapter 6 ✦ Setting Up for the Internet The tools people use range from crude command-line programs to completely graphical interfaces. This section lists some of these tools, which offer a broad range of flexibility. Balsa This mail client is included when you install the Gnome desktop environment. Balsa is Gnome’s mail tool. It has all the features required of a mail tool, such as the capa- bility to create, send, and read mail. If for some reason Balsa is not installed with Gnome, you can add it through the Debian package manager. When you launch Balsa for the first time, a graphical wizard guides you through the configuration. It asks you for the account name, e-mail address, server, and local mail directory. Make any changes to this information to ensure it is correct before proceeding. The next screen of the configuration process shows the paths for the mailboxes. Accept the defaults unless you are sure where to create them. You are then finished with the configuration of Balsa. A ~/balsarc file for each account contains the configuration information, but you can change it through the interface under the Settings menu option. Figure 6-1 shows what the interface looks like when reading a message. To access the mail- boxes, double-click the desired mailbox from the left-hand column. A tab appears on the right with the name of the mailbox. Clicking a message in that box makes it appear in the lower-right window where you can read it. Figure 6-1: Reading a message with Balsa 4710-0 ch06.F 4/10/01 11:22 AM Page 119 120 Part I ✦ Getting Started You can create additional mailboxes from the Mailboxes menu option. Choosing Add from the menu initiates a wizard to acquire the needed information to create a mailbox. Once a new mailbox exists, you can organize your e-mail by highlighting it and then right-clicking the message for a menu to appear. From this menu, you can reply, forward, delete, and even transfer e-mail to another mailbox. When creating a message to send, you can pick a name from the address book, which is extracted from the GnomeCard address book. GnomeCard is listed as the Address Book in the Applications section of the Gnome mail menu. You can add e-mail addresses to this address book for later retrieval in Balsa. Balsa is capable of using host names instead of domain names for sending mail. Most mail systems are connected to the Internet and therefore require fully quali- fied domain names. Private networks can send mail internally using a host name instead. Netscape Perhaps you first think of using Netscape as a browser. However, it also includes a fully functioning e-mail client. You have the advantage of using only one application for several functions. Another advantage is that when you browse a Web page and click a mailto link, a new message window appears for you to send an e-mail. Figure 6-2 shows the form used to create an e-mail message. Figure 6-2: Creating a message using the e-mail form with Netscape Mail Note 4710-0 ch06.F 4/10/01 11:22 AM Page 120 121 Chapter 6 ✦ Setting Up for the Internet You need to perform some customization for Netscape to work correctly. You can use the following instructions to set up Netscape for the first time or return to make changes at any time: 1. With the Netscape browser open, click the Edit menu item and select Preferences from the list of options. 2. From the left column of the dialog box, click the arrow next to Mail and Newsgroups. This expands a list of additional options. 3. Click the Identity item. From here, type the appropriate information about yourself in each field (name, e-mail address, and so on). 4. Click the Mail Servers. This displays the settings for the servers. The Add but- ton enables you to add as many accounts as you need for picking up mail (as long as they are IMAP servers). You can have only one POP mail account. You can also set the outgoing mail server. The details of the account — such as server names, type of server, and passwords—come from the ISP. You can change this information at any time using the preceding instructions. Once the Netscape Mail is set up, you can access the mail, respond, and file the mail as you do with other mail tools. mutt You see a slightly different style of graphical interface with mutt. mutt is a text- based mail client that uses the full display. The top line shows available commands. The second-to-last line shows the status information, such as number of messages, number of old messages, and the total disk space used by the messages. The last line of the display shows any message from mutt-like commands, error messages, and other such messages. mutt does not take any special configuration, and you can install it from the Debian package manager. Once installed, you can execute mutt from a command line or through the Debian Net menu under one of the desktops. Once running, press the question mark (?) to receive help with the commands. Although the basic commands appear at the top of the screen, several more exist for simple, quick keystroke execution. It is a good idea to become familiar with one of the text-based mail clients. When connecting to your systems remotely through a telnet session, you can still read your e-mail and respond to the messages. Some text-based clients may not work well under the virtual terminal session depending on the telnet client used on the remote system. Tip 4710-0 ch06.F 4/10/01 11:22 AM Page 121 [...]... is ‘^]’ Debian GNU/ Linux 2.2 serv1.mydomain.com hoth login: jo Password: Last login: Tue Oct 17 05: 23: 48 2000 from :0 on 0 Linux serv1 2.2.17 #1 Sun Jun 25 09:24:41 EST 2000 i686 unknown Most of the programs included with the Debian GNU/ Linux system are freely redistributable; the exact distribution terms for each program are described in the individual files in /usr/doc/*/copyright Debian GNU/ Linux. .. include a line like the following: S3: 23: respawn:/sbin/mgetty -x0 -s 57600 ttyS3 When you install mgetty, the preceding line is added This line specifies the short name for the modem device (S3), the run levels this service should make available ( 23) , and whether to set the service active (respawn) or not (off) It also specifies 129 4710-0 ch06.F 130 4/10/01 11:22 AM Page 130 Part I ✦ Getting Started the... pt2.F 4/10/01 11:22 AM Page 131 P Working with Debian A R T II ✦ ✦ ✦ ✦ In This Part Chapter 7 Applications Chapter 8 Productivity Applications Chapter 9 Essential Tools Chapter 10 Multimedia Chapter 11 Games ✦ ✦ ✦ ✦ 4710-0 ch07.F 4/10/01 11:22 AM Page 133 7 C H A P T E R Applications T here are thousands of applications already available for use with Linux in general — let alone Debian Volunteer programmers... before any damage occurs ✦ ✦ ✦ ✦ In This Chapter Alternatives for running legacy DOS/Windows applications Powerful graphics applications for Linux Internet browsers for Linux ✦ ✦ ✦ ✦ 4710-0 ch07.F 134 4/10/01 11:22 AM Page 134 Part II ✦ Working with Debian Installing non -Debian applications takes more effort on your part, but it is worth that effort Generally, the applications come as a tarball (everything... debugs an already running DOSEMU session 135 4710-0 ch07.F 136 4/10/01 11:22 AM Page 136 Part II ✦ Working with Debian ✦ xdos — This starts DOSEMU in its own X window You can also start it using dos -X ✦ dosexec — This starts DOSEMU and then executes a DEXE file You can also do load an executable DOS file using dos -L Now that you have a DOS session running on your Linux system, what do you do next? One... Type=floppy Label=Floppy Serial=8765 432 1 Device=/dev/fd0 [Drive C] Path=/mnt/win Type=hd Label=MS-DOS Filesystem=win95 [Drive D] Path=/cdrom Type=cdrom Label=CD-Rom Filesystem=win95 [Drive E] Path=/tmp Type=hd Label=Tmp Drive Filesystem=win95 [Drive F] Path=${HOME} Type=network Label=Home Filesystem=win95 137 4710-0 ch07.F 138 4/10/01 11:22 AM Page 138 Part II ✦ Working with Debian [wine] Windows=c:\windows... VMware does currently support the recently released XFree86 version 4.0 Software requirements for VMware: ✦ A standard Linux distribution with glibc version 2 or higher ✦ The kernel 2.0 .32 or higher for single processors, or kernel 2.2.x for multiprocessors ✦ An X server for XFree86 -3. 3 .3. 1 or higher 4710-0 ch07.F 4/10/01 11:22 AM Page 141 Chapter 7 ✦ Applications If your system does not meet these requirements,... regions using Bezier curves 3 Selects shapes from images 1 Moves layers and sections 2 Zooms in and out 3 Crops the image 1 Transforms the layer or selected area 2 Flips the layer or selected area 3 Adds text to the image 1 Picks colors from the image 2 Fills area with a color or pattern 3 Fills area with a color gradient 1 Draws sharp pencil strokes 2 Paints fuzzy brush strokes 3 Erases to background or... dual boot system — Windows and Linux You can add the Windows partition to the filesystem to make it accessible to Linux Add the following line to your /etc/fstab file: /dev/hda1 /mnt/win vfat defaults,user 0 0 4710-0 ch07.F 4/10/01 11:22 AM Page 137 Chapter 7 ✦ Applications /dev/hda1 is the Windows partition containing the Windows software /mnt/win is the starting path that Linux uses to mount the Windows... Debian Figure 7 -3: Install the entire operating system in a virtual machine Figure 7 -3 shows Windows 98 being installed on a virtual machine The environment looks and acts just like a machine to the operating system that is installed on it If you click in the window, the mouse moves, clicks, and drags the components of that environment When you press Ctrl+Alt+Esc, the mouse control returns to the Linux . included with the Debian GNU/ Linux system are freely redistributable; the exact distribution terms for each program are described in the individual files in /usr/doc/*/copyright Debian GNU/ Linux comes. remotehost. Escape character is ‘^]’. Debian GNU/ Linux 2.2 serv1.mydomain.com hoth login: jo Password: Last login: Tue Oct 17 05: 23: 48 2000 from :0 on 0 Linux serv1 2.2.17 #1 Sun Jun 25 09:24:41. (password) PPP session from 209. 43. 51.117 to 198.70.144.2 13 beginning [7f][ 03] @![01][01][1f][01][04][05][02][06][7f][7f][7f][7f][05] [06]^[19][7f]0[07][02][08][02][11][04][05][ 13] [ 03] ~[7f]}#@!}!} “}}?}!}$}%}”}&[7f][7f][7f][7f]}%}&^}9[7f]0}’}”}(}”}1}$}% }3} #} ;a~

Ngày đăng: 14/08/2014, 04:21

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan