Networking Applications


Numerous networking applications are available for FreeBSD. This section will concentrate on web browsers, email, and FTP applications.

Web Browsers for X11

In FreeBSD, you have your choice of several excellent web browsers, all of them featuring advanced functionality such as tabbed browsing and pop-up blocking, making them demonstrably better in many ways than the standard offerings on Windows. At the heart of the web browser universe is the Mozilla family of browsers, dating back to the opensource transition made by Netscape when it was forced to concede defeat on the consumer desktop to Microsoft Internet Explorer. In the ensuing several years, the dedicated core Netscape development team and the many thousands of contributing developers around the world brought out the Gecko rendering engine, the Mozilla browser (and Netscape 6/7, its commercial counterpart), and finally Firefox, the cross-platform browser that has attained widespread respect that the Netscape team hadn't seen since 1996. Gecko has at the same time found its way into the back-end of many alternative browser projects, including Epiphany, the web/desktop browser built into GNOME.

At the same time, alternative browsers based on newer, faster rendering engines were being developed, such as Konqueror (KDE's built-in browser), founded on the KHTML rendering engine. KHTML is so efficient and complete that it forms the basis for Safari, Apple's browser built into Mac OS X.

If you're using KDE, you might want to use Konqueror as your browser; if you're on GNOME, Epiphany might be your choice. However, for either of those desktop environments, or if you're using a plain window manager, running Mozilla or Firefox is a choice you probably won't regret.

Note

Because Firefox is a cross-platform browser that you can use on Windows or Mac OS X as well as on FreeBSD, you can stick with it on all your computers no matter what operating systems they're running; you can also use a centralized bookmark system like del.icio.us to ensure a consistent browsing experience on all platforms.


Both Firefox and Mozilla are available as ports or packages in the www category. Once installed, you start the browser with the mozilla or firefox command (as appropriate) or by choosing it from the menu of applications in KDE or GNOME.

When you first launch Firefox, it gives you the opportunity to import your preferences, bookmarks, and other information from an earlier installation of Netscape or Mozilla. Choose the appropriate option and click Next to be guided through the process of importing your data if necessary. When you're done with that, you're ready to use Firefox (shown in Figure 6.12), with all the modern features that have made it so popular on all platforms.

Figure 6.12. The Firefox web browser. Click the circular flower pattern at the right end of the menu bar to see how to use some of Firefox's more interesting features.


Firefox's extensive configuration options are available by selecting Edit, Preferences. You can modify many aspects of Firefox's appearance and behavior, including how it handles your saved browsing history, passwords, form information, and cookies.

The Lynx Web Browser

Lynx is a CLI web browser that runs in text mode and has no graphical capabilities. It attempts to render web pages in as close as possible a format to how they would appear in a graphical browser. It's getting more and more difficult to navigate the Web with Lynx these days because it does not support images, frames, JavaScript, CSS, Flash, or any of the other technologies that make today's web what it is. Because many sites are using images as links and not making use of ALT tags, this can cause navigational problems in Lynx that are difficult or impossible to get around. However, Lynx is still an indispensable tool for downloading important files or getting crucial information from utilitarian sites such as download repositories or documentation archives, particularly if you're on a system that doesn't have X11 installed. Figure 6.13 shows Lynx with the (now rather Lynxunfriendly) FreeBSD website loaded into it.

Figure 6.13. The FreeBSD website in Lynx.


Lynx can still work on quite a few sites, although navigation is not always easy. Use the Up and Down arrow keys to move between links in the browser window, and the Right and Left arrows to navigate forward (using the selected link) and backward. The spacebar is the equivalent of Page Down. Type G to change to a different website; you will be asked to enter a URL after typing G. Q quits Lynx when you're done.

Lynx can be installed from the ports or packages (in the www category). For more information on Lynx, including customization options, refer to the man lynx page.

Tip

Lynx is gradually being replaced by more full-featured textual browsers, such as w3m and links, both available in the www category of the ports or packages. Both these browsers make a game attempt at rendering elements such as frames, tables, and menus, which are beyond the ambitions of Lynx.


FTP

FTP (File Transfer Protocol) is a time-honored and reliable method of transferring files between systems. Windows users might be familiar with FTP only as a way to download software from a central distribution server; but as the owner of a FreeBSD system, you'll be able to set up your machine as an FTP server for two-way file-transfer that requires a minimum of hassle. (See Chapter 27, "Configuring an FTP Server," for more information.)

Using FTP to download (or upload) files is a utilitarian endeavor that has never inspired much development effort for GUI-based applications in the open-source world. The traditional way to transfer files over FTP is the old-fashioned way: on the command line, using the ftp program.

To start an FTP session, type ftp followed by the name of the server you want to connect to. For example, to connect to the FreeBSD FTP server, you would type the following:

# ftp ftp.freebsd.org


After you have done this, and assuming the connection is successful, you will eventually see something like the following:

Connected to ftp.freebsd.org. 220 ftp.FreeBSD.org NcFTPd Server (licensed copy) ready. Name (ftp.freebsd.org:btman):


You might be connecting to a private FTP server, where you need to have a user account established, or a public server where you can log in anonymously. If it's a private server, enter your account name at the Name prompt and press Enter, and then enter your password when prompted. If it's a public server, however, enter the special username anonymous. You'll see the following further prompt:

331 Guest login ok, send your e-mail address as password. Password:


Public FTP servers use the password as a means of logging who's accessed the system, and they ask that you use your email address as your passwordit's an entirely voluntary matter to give your real email address. Either enter your real address or a fake one as your password. Note that the password will not echo to your screen.

After you have logged in, you may get a welcome message and finally something that looks similar to the following:

Remote system type is UNIX. Using binary mode to transfer files. ftp>


At the prompt, you can use many of the same shell commands that you use at your local shell to navigate through the FTP server. (See Chapter 8 for details on how to work with shell commands.) Table 6.9 provides a list of some of the most commonly used commands in an FTP session.

Table 6.9. Commonly Used FTP Commands

Command

Action

ls

Lists the directory contents of the remote host.

cd

Changes the directory on the remote host.

pwd

Displays the current directory you are in on the remote host.

lcd

Changes the directory on the local host. (Only available in some FTP client programs.)

binary

Transfers files in binary mode (this mode should be used for anything other than plain-text).

ascii

Transfers files in ASCII mode (this mode should be used only for plain-text, and then only if necessary). The purpose of ASCII mode is to translate end-of-line characters in text files from the format used on the source host to the format used on the destination host. If you're transferring files from UNIX to Windows or vice versa, ASCII mode is important; but between UNIX machines, no translation is necessary, so it doesn't matter.

put filename remotename

Copies filename to the remote host. filename is assumed to be in the current directory unless a path is specified. If no destination file is specified, the file will be placed in the current directory in the remote host and have the same name as the local file. (This command works only if you have permission to write to the directory on the remote machine.) remotename is optional; if specified, the file is renamed to that name on the remote host.

mput file1 file2

Copies multiple files in a list to the remote host. The files will be placed in the current directory on the remote host. (This command works only if you have permission to write to the directory on the remote machine.)

get filename localname

Copies a file from the remote host to the local system. If no path is specified, the file is assumed to be located on the current directory on the remote host. If no destination file is specified, the file will be copied to the local system using the same filename. localname is optional; if specified, the file is renamed to that name on the local host.

mget file1 file2

Gets multiple files in a list from the remote host. The files will be placed in the current directory on the local system. This can also take * as a wildcard to get all files in a directory matching a specification.

mkdir dirname

Creates a directory called dirname on the remote machine (assuming you have permission to do so).

rmdir dirname or rm dirname

Removes the directory called dirname on the remote machine (assuming you have permission to do so).

del filename

Deletes the file filename from the remote machine (assuming you have permission to do so).

bye or quit

Closes the connection with the remote host and quits the FTP program, returning you to the shell prompt.


You can also type help at the ftp> prompt to get a list of available commands. Type help followed by one of the commands in the list to get a short description of what that command does. Here's an example:

ftp> help Commands may be abbreviated.  Commands are: !              features       mls            prompt          site $              fget           mlsd           proxy           size account        form           mlst           put             sndbuf append         ftp            mode           pwd             status ascii          gate           modtime        quit            struct bell           get            more           quote           sunique binary         glob           mput           rate            system bye            hash           mreget         rcvbuf          tenex case           help           msend          recv            throttle cd             idle           newer          reget           trace cdup           image          nlist          remopts         type chmod          lcd            nmap           rename          umask close          less           ntrans         reset           unset cr             lpage          open           restart         usage debug          lpwd           page           rhelp           user delete         ls             passive        rmdir           verbose dir            macdef         pdir           rstatus         xferbuf disconnect     mdelete        pls            runique         ? edit           mdir           pmlsd          send epsv4          mget           preserve       sendport exit           mkdir          progress       set ftp> help mdir mdir            list contents of multiple remote directories ftp>


For more information on using FTP, read the manual page for FTP by typing man ftp at the shell prompt. You might also want to read the sections in Chapter 8 on file-manipulation commands because the commands used in FTP are similar.

Listing 6.1 shows what a sample FTP session might look like.

Listing 6.1. A Sample FTP Session

[View full width]

# ftp ftp.freebsd.org Trying 62.243.72.50... Connected to ftp.freebsd.org. 220 ftp.FreeBSD.org NcFTPd Server (licensed copy) ready. Name (ftp.freebsd.org:btman): anonymous 331 Guest login ok, send your complete e-mail address as password. Password: 230-You are user #113 of 1000 simultaneous users allowed. 230- 230 Logged in anonymously. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 502 Unimplemented command. 227 Entering Passive Mode (62,243,72,50,247,103) 150 Data connection accepted from 12.104.153.15:4481; transfer starting. drwxr-xr-x   3 ftpuser  ftpusers       512 Oct 12 09:27 pub drwxr-xr-x   3 ftpuser  ftpusers       512 Oct 12 10:48 sup 226 Listing completed. ftp> cd pub/FreeBSD/tools 250 "/pub/FreeBSD/tools" is new cwd. ftp> get gunzip.exe local: gunzip.exe remote: gunzip.exe 227 Entering Passive Mode (62,243,72,50,245,41) 150 Data connection accepted from 12.104.153.15:4542; transfer starting for gunzip.exe  (37178 bytes). 100% |*************************************| 37178      42.41 KB/s    00:00 226 Transfer completed. 37178 bytes received in 00:00 (42.38 KB/s) ftp> bye 221 Goodbye. #

If you would rather work with a graphical FTP client in X11, several GUI-based FTP client applications are available in the ftp category, including several that integrate with KDE (such as Kasablanca) and several that work under any desktop (such as ftpcube), and some that operate equally well in both modes (such as gftp). These full-featured FTP clients generally support SSL/TLS encryption, multiple threads, site management (bookmarks), and drag-and-drop file transfers. As convenient and user-friendly as these applications are, though, most UNIX users still fall back on the trusty CLI FTP client for all their day-to-day file-transferring needs.

Email Applications

Email was one of the earliest applications for the Internet, and it's still the most popular and necessary. There is no shortage of email clients available for FreeBSD, of both the CLI and GUI varieties. As a FreeBSD administrator, you'll need to install email client applications not just for yourself, but for any users you might allow to use your systemthey might choose to use a command-line email client like Pine right on the FreeBSD server instead of a GUI-based client on their Windows machines. This section will look at some of the more popular email clients available both for the shell and for X11.

Tip

In addition to having an Internet connection configured and working properly, you will also need to have a Mail Transfer Agent (MTA) such as Sendmail configured and working properly before you can use some of these email clients. In addition, if you need to retrieve your mail from a POP3 or IMAP server at your ISP, you will also need to have Fetchmail configured. Not all the clients listed here will require this because some can transfer mail on their own; but if you're ambitious and a UNIX purist, you might still choose to use Fetchmail in concert with a local MTA. This setup allows much greater flexibility in dealing with email because it uses FreeBSD's native mail-handling system, allowing the shell or utilities such as xbiff to notify you when you have new email. These features will not work if you use the mail client's built-in mail-handing functions. See Chapter 25, "Configuring Email Services," for details on how to set up and configure FreeBSD to send and receive email.


Pine

Pine is a text-based email and news client that was designed with nontechnical UNIX users (for example, university students) in mind. Because of its comparative ease of use and the fact that it's shell-based, any number of remote users who log in on a remote terminal can efficiently manage their email without having to maintain any heavyweight email client applications on their own computers.

Pine is available in the FreeBSD ports or packages in the mail category. Figure 6.14 shows the main menu of Pine.

Figure 6.14. Pine is menu-driven and can be navigated with the arrow keys or by pressing the letter in front of any menu entry.


Unfortunately, Pine has a reputation of being poorly programmed and having a lot of security problems. Although all the known problems have currently been fixed, many security experts believe that there are many more security holes in Pine that have not yet been discovered. Some even place the likely number of undiscovered holes in the thousands. You will also be warned of these potential security issues with Pine when you install the port. If you do decide to make Pine available to your users, you should make sure your users are aware of the potential security hazards involved in using Pine.

If security is a high-level concern on your system (for example, if you have confidential data on the system that these users have access to), it is probably best to forbid the use of Pine altogether (in other words, don't install Pine, or uninstall it if it is already installed). Your users may have fits, but in some situations, security may be more important than user convenience. Other mail programs are available that your users can use (one popular alternative, Mutt, is discussed in the next section). Although they may not be as easy to use as Pine, these programs are generally much more secure.

Caution

Although it is generally a bad idea to open any email while logged in as root, it is even more so with Pine. This is because of the nature of some of the potential holes in Pine that might allow someone to execute arbitrary code on your system as the user running Pine simply by sending a maliciously corrupted email header to that user (even root). It is a much better idea to forward root's mail to a normal user account and then read the email using that account instead. Instructions on email forwarding can be found in Chapter 25.


Tip

You might not want to use Pine for email, but there's still an excellent reason to install it: it comes with the pico text editor, which is Pine's internal mechanism for message composition but also included as a separate program. Many users choose pico over ee, vi, or any other CLI text editor, for its straightforward and efficient keystroke-driven interface and its handy auto-justification function.


Mutt

Mutt is another text-based email client for FreeBSD and other UNIX-like operating systems. It is available in the FreeBSD ports or packages in the mail category. Figure 6.15 shows the main screen of Mutt.

Figure 6.15. Although it does not have the simple menu-driven interface of Pine, Mutt is much more secure than Pine and is also more configurable.


Mutt got its name because it is known as "the mongrel of mail clients." This is because it is a relatively new mail client that attempts to combine the best features of Elm (a very old email client that is not widely used anymore) and Pine (which was designed to be much easier to use than Elm). Mutt has many users who would agree that the client successfully fulfills these goals.

Mutt is a very complex program with a rich set of features, and it's still under active development today. Its use and configuration is beyond the scope of this book. The Mutt website, located at www.mutt.org, has very good online documentation and reference manuals that explain the use and configuration of this powerful program.

uuencode and uudecode

A brief word on uuencode and uudecode is in order here. uuencode (UNIX-to-UNIX Encode) is a method of converting binary files to plain-text so that they can be sent through email, because SMTP (the Internet's standard mail delivery protocol) can only handle plain-text data. Without uuencode and other forms of encapsulation of binaries, email with attachments or included images wouldn't be possible.

Often, the email client will handle encoding and decoding of the attachments automatically; Pine, for instance, will detect attached files and present them as links so you can save them directly instead of making you decode them yourself. However, it doesn't always work out quite so well. Sometimes, you may receive an email that has an attachment that the mail client doesn't decode properly, and it appears as several hundred lines of what appears to be garbage text. It will look something like the following:

begin 644 gunzip.exe M35HZ`4D````"`.I6___/6H`````.`,4('````$Q:.3'_\8X&W"<F_S9(`/M& M`'_XN&\#'E"X9"+[F@(%FO__!X/$#,N058OL@^P$N"0'B7^,1OR,7OZX!`?= M#B;_^\7X#A3HQ?@*%`[HH?_K'\(AD,1>_(/&!-MW<.,"_#>X(-GX#@S@)O]W MBP<F"T<"==2+Y5W+D/V4`U-KD/U8SV*0^!%HD/@/E/@1=*<6E/@?N'C>@J/X M$8BC^`\H]7#NGONEY/@.$+C>ML'N^`X(N,_N^!#A[O@0Z^[X$/)=_^[X$/CN M^!`#".[X#E[U"E=6QT;Z$!\`107?C48(%L-'^P;[FE(#QP4&",,@WB"C/B&)


These are what the first several lines of a uuencoded file may look like. The begin line contains the name of the file that this file will be saved to when uudecoded.

To decode the file, save the attachment (or email message) that contains the garbage text to a file in the directory where you want to decode it. For example, suppose you save the file as program.txt. You can now use the following command to decode the file:

# uudecode program.txt


This will decode the file and write the contents to whatever filename is given in the encoding. In this example, the command would produce an output file called gunzip.exe.

If you need to encode a file, you can do so with a command like the following (assume that the file you want to encode is called gunzip.exe):

# uuencode gunzip.exe gunzip.exe > gunzip.txt


The three arguments in the preceding command are the name of the file you want to encode (in this case gunzip.exe), the name of the output file that should be produced when the file is decoded (usually this will be the same as the input file, as in this example), and a redirect of the output to a file called gunzip.txt, which will contain the encoded file. The > character tells the shell to redirect the output to whatever destination is on the right side of it. If you do not do this, the output will be sent to the screen instead. This allows the output to be piped directly into a mail program, for example, if you want to send the encoded file to someone, as in this example:

# uuencode gunzip.exe gunzip.exe | mail -s "Here's that program you wanted" asmith@somewhere.com


See Chapter 8 for more information on input/output redirection and pipes.

Tip

Other kinds of encoding, such as Base64, are even more common than uuencode these days. If you receive a Base64-encoded file in email, you might need another program such as UUDeview (available in the converters section of the ports or packages) to decode it.


GUI Email Clients

With the rise of modern full-featured email clients for Windows and Mac OS X that get their mail through POP or IMAP, it's inevitable that these kinds of applications would eventually come to the correspondingly full-featured desktop environments of KDE and GNOME. If you want such features as spam control, address-book integration, WYSIWYG message composition, graphical attachments, drag-and-drop folder interaction, multiple accounts and identities, message filtering rules, and other such modern niceties, a graphical email client is a must.

If you're using your FreeBSD machine as a workstation and you have a POP or IMAP account from which you're accustomed to getting your email, there are several options available to you, depending on your choice of desktop. KDE users will want to use KMail, as shown in Figure 6.16. GNOME users can use the built-in Evolution, or might opt for Balsa, a third-party application that must be installed separately, but which is designed with GNOME in mind. Finally, Thunderbird, the email client developed in tandem with Firefox and by the same people, is an excellent and full-featured choice for users of any desktop environment.

Figure 6.16. KMail, a full-featured and modern email client for KDE.





FreeBSD 6 Unleashed
FreeBSD 6 Unleashed
ISBN: 0672328755
EAN: 2147483647
Year: 2006
Pages: 355
Authors: Brian Tiemann

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net