Tải bản đầy đủ (.pdf) (5 trang)

Tài liệu Configuring FTP Services in Linux ppt

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (36.96 KB, 5 trang )

1 - 5 IT Essentials II v1.1 - Lab 10.4.4 Copyright  2002, Cisco Systems, Inc.
Lab 10.4.4: Configuring FTP Services in Linux


Estimated Time: 25 minutes
Objective
In this lab, the student will configure a Linux Red Hat 7.2 computer with FTP services.
The student will also create a FTP server.
Equipment
The following equipment is required for this exercise:
• A computer system running Linux Red Hat 7.2 or newer
Scenario
The Marketing Director of the XYZ Company has requested an FTP site so employees in
the Marketing and Sales Department will be able to access and download files when
away from the office. An FTP site must be created on the server for them to access.
Procedures
In Linux Red Hat 7.2, the FTP services are not started by default. In this lab, the student
will first have to navigate to the configuration file to start the FTP services. In the first step
of this lab, the student will configure the FTP configuration file. In the second Step of this
lab, the student will start the FTP services and build the content that will be on the FTP
server. The procedures for starting the FTP services will be done in much the same way
that the Telnet services are started.
Step 1: Configuring the FTP Server
1. Log-in with the root account. FTP services can only be started with the root account.
Make sure to be at the CLI command prompt. If in the GUI interface, open up a
terminal emulator window.
2. Once at the command prompt interface type:
cd/etc/xinetd.d
This will change the user to the proper directory where the Telnet configuration file is
located.
3. Next, type:


ls
2 - 5 IT Essentials II v1.1 - Lab 10.4.4 Copyright  2002, Cisco Systems, Inc.
This will display a list of all the configuration files in the xinetd.d directory.
4. Locate the wu-ftpd configuration file. Is the wu-ftpd file in this directory?
Y/N
If the wu-ftpd file is not found, install it now. Ask the instructor or lab aid for help.
5. At the command prompt, type:
vi wu-ftpd
This will allow use of the vi Editor to change the Telnet configuration file.
6. Once the vi Editor window opens, press “i” on the keyboard to enter “insert” mode.
Locate the “disable = yes” line in the configuration file as shown in the graphic:

7. Use the arrow keys on the keyboard to move the cursor to delete the word “yes” and
replace it with “no”. This will change the configuration file to allow FTP access to the
server.
8. To exit the vi Editor, hit the Esc first, then hit the “:” key, and then type “wq”. This will
save the changes that have been made.
Step 2: The xinetd Daemon
Before testing the FTP services, make sure that the FTP daemon is running. The
daemon that runs the FTP services is called xinetd.
1. From the command prompt type:
/etc/rc.d/init.d/xinetd stop
2. Next, start the xinetd daemon:
3 - 5 IT Essentials II v1.1 - Lab 10.4.4 Copyright  2002, Cisco Systems, Inc.
/etc/rc.d/init.d/xinetd start
3. Check the status of the xinetd daemon:
/etc/rc.d/init.d/xinetd status
In the space below, write down the status of the xinetd daemon:
__________________________________________________________________


Example of the xinetd daemon being stopped and started.
Step 3: Testing the FTP Properties
1. To test if the FTP services are working properly from a terminal window, type:
ftp localhost
This command will use the system to access the FTP services on the system.
2. The Linux system will attempt to make a FTP connection to the system through the
local loopback address 127.0.0.1. It will run through the login procedure and prompt
the user to enter a username and password.
3. Login using a student account (do not use the root account to log on). When
prompted, type the student account name and password.
4. If connected to the system, then you have successfully configured your Linux Red
Hat Server for FTP access.
Example of a successful FTP login
4 - 5 IT Essentials II v1.1 - Lab 10.4.4 Copyright  2002, Cisco Systems, Inc.
5. To see the current working directory, type:
pwd
6. To see the files in the current directory, type:
ls –a
7. To exit the FTP session, type:
bye
Step 4: Connecting to Other FTP Systems (optional)
To complete this exercise, the user will need to work with another student on a system
that is networked to the computer being used.
1. From a terminal window, type:
ifconfig
Write down the IP address of eth0. Exchange IP addresses with a classmate.
_______________________________________________________________
2. Create a temporary user for the FTP purposes:
adduser ftpclient
3. Give the new ftpclient a password:

passwd ftpclient
When prompted, make the password the same as the account name, for example,
ftpclient.
4. Create a file that can be viewed and transferred. First, go into the newly created
ftpclient home directory, and type:
cd/home/ftpclient
Next, type:
touch <hostname>
The name of the file that is created with the touch command will be the same as the
computer’s host name. As an example, if the hostname is systemA1 then the
command to create the file would be touch systemA1. Verify that this file exists
with the ls command.
5. FTP to the classmate’s computer. With the IP address from step 1 above, type:
ftp IPaddress
Log-in using the ftpclient account and password.
5 - 5 IT Essentials II v1.1 - Lab 10.4.4 Copyright  2002, Cisco Systems, Inc.
6. After you have logged in to the classmate’s computer, FTP their file by typing:
get <hostname>
This will bring their file to the computer being used. Verify that the file has been received
with the ls command, or view the file in a KDE window.
Was the file received? Y/N
__________________________________________________________________
Troubleshooting
If having trouble connecting to the FTP site, check the IP address that is typed in the
browser as well as the IP address that was specified in the FTP site properties page. If
the network’s IP addresses are assigned dynamically with a DHCP server, then the IP
address might change from time to time. It is a good idea to assign the FTP server a
static IP address so that the IP address does not change. Having the IP address
changing all the time could create a lot of administrative costs and trouble from users and
customers who will be calling and saying they cannot access the FTP site anymore.

If having difficulties with the Linux FTP client, try a windows computer. A Windows
system can easily connect to a Linux FTP server by using a popular program called
WS_FTP. If familiar with WS_FTP, try to connect to the Linux system and download the
file directly to the PC.
Reflection
If setting up an FTP server in a business or corporate network, routers and firewalls will
have to be configured to allow FTP access to the FTP server. Remember that the IP
address of the FTP server might not be a public IP address and therefore will not be
directly connected to the network. In this case, configure the router to forward incoming
FTP requests to the proper computer on which the FTP server resides. Keep in mind that
the IP address of the Web or FTP must be statically assigned.

×