How to configure FTP Client in RHEL Linux?

• Go to the client machine and check the ftp package is installed or not

[root@sys1 ~]# rpm -q ftp
package ftp is not installed
Install the ftp package for the client.
[root@sys1 ~]# yum install ftp
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ftp.x86_64 0:0.17-53.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved
==================================================
Package      Arch          Version          Repository             Size
==================================================
Installing:
ftp               x86_64      0.17-53.el6     ithonours-repo       58 k
Transaction Summary
==================================================
Install 1 Package(s)
Total download size: 58 k
Installed size: 95 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : ftp-0.17-53.el6.x86_64 1/1
Verifying : ftp-0.17-53.el6.x86_64 1/1
Installed:
ftp.x86_64 0:0.17-53.el6
Complete!

 

• Now connect to the ftp server using the ip address .

[root@sys1 ~]# ftp 192.168.1.5
Connected to 192.168.1.29 (192.168.1.29).
220 (vsFTPd 2.2.2)
Name (192.168.1.29:root): ftp

 

Use the user name as ftp for logging as an anonymous user.

It asks for password doesn’t give the password and press enter.

Name (192.168.1.29:root): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.

 

• After this we entered into the /var/ftp of the server.

ftp> cd /pub
250 Directory successfully changed.
ftp> ls
227 Entering Passive Mode (192,168,1,29,179,221).
150 Here comes the directory listing.
-rw-r--r--    1   0   0   0   Feb   02   14:06   ithonours1
-rw-r--r--    1   0   0   0   Feb   02   14:06   ithonours2
-rw-r--r--    1   0   0   0   Feb   02   14:06   ithonours3
226 Directory send OK.

 

To download the file the command is get file_name

ftp> get ithonours1
local: ithonours1 remote: ithonours1
227 Entering Passive Mode (192,168,1,29,220,16).
150 Opening BINARY mode data connection for ithonours1 (0 bytes).
226 Transfer complete.

 

• To see whether the file is downloaded or not do as follows

ftp> !ls
anaconda-ks.cfg Desktop Documents Downloads install.log install.log.syslog ith1 ithonours

 

The client side list of commands to access the files in the server in ftp prompt

? to request help or information about the FTP commands
ascii

to set the mode of file transfer to ASCII
(this is the default and transmits seven bits per character)

binary to set the mode of file transfer to binary
(the binary mode transmits all eight bits per byte and thus provides less chance of a transmission error and must be used to transmit files other than ASCII files)
bye to exit the FTP environment (same as quit)
cd to change directory on the remote machine
close

to terminate a connection with another computer

close Brubeck

closes the current FTP connection with brubeck,
but still leaves you within the FTP environment.

delete to delete (remove) a file in the current remote directory (same as rmin UNIX)
get

to copy one file from the remote machine to the local machine

get ABC DEF:

copies file ABC in the current remote directory to (or on top of) a file named DEF in your current local directory.

get ABC:

copies file ABC in the current remote directory to (or on top of) a file with the same name, ABC, in your current local directory.

help to request a list of all available FTP commands
lcd to change directory on your local machine (same as UNIX cd)
ls to list the names of the files in the current remote directory
mkdir to make a new directory within the current remote directory
mget

to copy multiple files from the remote machine to the local machine;
you are prompted for a y/n answer before transferring each file

mget *

copies all the files in the current remote directory to your current local directory, using the same filenames. Notice the use of the wild card character, *.

mput

to copy multiple files from the local machine to the remote machine;
you are prompted for a y/n answer before transferring each file

open

to open a connection with another computer

open Brubeck

opens a new FTP connection with brubeck;
you must enter a username and password for a brubeck account
(unless it is to be an anonymous connection).

put to copy one file from the local machine to the remote machine
pwd to find out the pathname of the current directory on the remote machine
quit to exit the FTP environment (same as bye)
rmdir to to remove (delete) a directory in the current remote directory

 

Topics Summary