Using FTP

File Transfer Protocol—or FTP—is one of the most popular (and speediest) means of transferring files between systems. Since FTP client programs are available for every operating system, it's pretty much the closest thing to a universal file transportation mechanism.

Red Hat Linux 6 ships with an FTP server called Wu-ftpd. If you need to provide remote FTP access to your Linux server, Wu-ftpd will allow you to do this.

It is quite likely that Wu-ftpd is already installed on your system, although this depends on the kind of installation you selected and the packages you chose. (Wu-ftpd is part of the default server installation.) If it is not present on your system, use Gnome RPM, as explained in Chapters 2 and 3, to install it from the Red Hat Linux 6 VQS CD.

Assuming that Wu-ftpd is installed on your server, FTP service is automatically invoked whenever anyone connects to the FTP port. (Since you may be prompted for the information by a client FTP program, you should know that this is port 21.)

Generally, there are two sorts of users allowed access to an FTP server:

  • Those with an account and password

  • Anonymous, or guest, users

In this context, account means a logon ID with a shell account. This means that you must be sure to give every user who needs FTP access a shell account as listed in the /etc/passwd file.

Anonymous FTP is used when you want to give the world access to certain files on your server. Although you can log access to an anonymous FTP server—it is conventional to request an email address—you certainly cannot control who uses it. You therefore must be careful about what you provide to anonymous FTP users, and you should be aware that any anonymous FTP service introduces some security risks (see "Security" later in this chapter).

To use the Linux Configuration tool to configure Wu-ftpd:

1.
Log on as root.

2.
Select LinuxConf from the System fly-out of the Gnome Main menu.

The Linux Configuration tool will open.

3.
Scroll down in the pane on the left and select Basic Configuration under FTP Server (wu-ftpd). The Misc tab of the FTP Server Configuration dialog box will open on the right (Figure 13.9).

Figure 13.9. you can configure the Wu-ftpd FTP server using the linux configuration tool.


4.
On the Misc tab, verify your email address.

5.
In the Banner File box, enter a file name if you would like a message displayed before a user logs on.

The text of the message goes in the file you reference. This could be an appropriate place to list available files or to mention security procedures.

6.
Similarly, designate a file for a good-bye message in the Shutdown message box.

7.
Click the Control tab.

The control panel lets you set the authority in a number of areas for real users (meaning those with a logon ID and shell account; see Figure 13.10) and for guest and anonymous users (Figure 13.11).

Figure 13.10. By default, real users-who have a shell account and logon ID-have most privileges.


Figure 13.11. By default, guest and anonymous users are not very privileged.


8.
Select the privileges you want each kind of user to have.

9.
Click Accept.

Tip

The access of anonymous and guest FTP users is restricted to the /home/ftp directory and its subdirectories.


Tip

You can control more aspects of Wu-ftpd by working directly with its configuration files:

  • /etc/ftpaccess

  • /etc/ftpconversions

  • /etc/ftphosts


To log on to the FTP server as a realuser:

1.
Open a Gnome terminal window.

2.
At the command prompt, type ftp followed by the domain name or the IP address of the FTP host.

3.
Press Enter.

The banner message will be displayed.

4.
At the prompt, enter your name (Figure 13.12).

Figure 13.12. When logging on as a real user, you must supply your name and password.


5.
Press Enter.

6.
At the prompt, enter your password.

7.
Press Enter.

You should now see the FTP prompt: ftp>

To list FTP commands:

1.
At the FTP prompt, type ?

2.
Press Enter.

The available FTP commands will be displayed.

To list files available on an FTP server:

1.
At the FTP prompt, type ls.

2.
Press Enter.

The files in the current directory will be listed (Figure 13.13).

Figure 13.13. To list the files available in the current FTP server directory, type ls.


Tip

The FTP commands available are a subset of the file manipulation commands available in Linux, which are explained in Chapters 10 and 11. For more FTP commands, see Appendix A.


To download a file:

1.
At the FTP prompt, enter the cd command to go to the directory of the file you want.

2.
Enter the lcd command to change local directories to go to the location where you want the downloaded file to be saved.

3.
Type binary to enable binary file transfer.

4.
Press Enter.

5.
Type hash to enable hash mark displays while the file is downloading.

6.
Press Enter.

7.
Type get thefilename, where thefilename is the name of the file you want to download.

8.
Press Enter.

To exit the FTP command-line client:

1.
At the FTP prompt, type quit.

2.
Press Enter.

To log on anonymously:

1.
Type ftp followed by the name of the server.

2.
Press Enter.

3.
When prompted for your name, type anonymous

4.
Press Enter.

5.
When prompted for your password, enter your email address.

Using Gnome FTP

Gnome FTP—gFTP—is a visual FTP client that ships with Red Hat Linux 6 (Figure 13.14). Visual FTP clients make the whole business of connecting to FTP servers and transferring files a matter of menu operations and drag-and-drop operations. For many people, this approach is preferable to mastering the arcane aspects of command-line FTP.

Figure 13.14. Gnome FTP—gFTP—allows you to perform FTP functions without having to know the FTP command syntax.


To open gFTP:

1.
Select File Manager from the Gnome main menu.

2.
With the File Manager open, scroll down to the /usr/bin directory.

3.
Click /usr/bin to expand the listing of files in the right pane.

4.
In the right pane, scroll down until you see the file gftp.

5.
Double-click gftp.

Gnome FTP will open.

Using Windows FTP clients

You can connect to your Linux FTP server with great ease using Microsoft Windows FTP clients. The Windows command-line FTP utility accepts the same commands as the Linux version.

To log onto your FTP server using the Windows command-line client:

1.
On the Microsoft Windows desktop, click Start.

2.
From the Programs menu, choose MS-DOS Prompt.

A DOS box will open.

3.
At the DOS prompt, type ftp followed by the name or IP address of your FTP server.

4.
Press Enter.

After logging on, you will be able to use FTP commands as in the Linux utility (Figure 13.15).

Figure 13.15. The windows FTP command-line client works in the same fashion as the linux utility.


Tip

There are many good visual FTP clients available for Microsoft Windows. Figure 13.16 shows FTPx Corporation's FTP Explorer.


Figure 13.16. FTP Explorer is a visual FTP client for Microsoft windows.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.113.163