FTP (File Transfer Protocol) is a standard network protocol used to transfer files to and from a remote network.
In this tutorial, we will show you how to use the Linux ftp
command through practical examples.
In most cases, you will use a desktop FTP client to connect to the remote server and download or upload files. However, the ftp
command is useful when you work on a server without GUI and you want to transfer files over FTP to or from a remote server.
FTP traffic is not encrypted. For a secure data transfer, use SCP or SFTP .
To be able to transfer files, you must have at least read permissions on the source file and write permission on the target system.
When transferring large files it is recommended to run the ftp command inside a screen or tmux session.
The directory from where you run the ftp
command is the local working directory.
ftp
command followed by the remote server IP address or domain name. For example, to connect to an FTP server at “192.168.42.77” you would type:ftp 192.168.42.77
linuxize
:220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 21:35\. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (192.168.42.77:localuser): linuxize
You may see a different confirmation message depending on the FTP service running on the remote server.
Password:
ftp>
prompt.230 OK. Current restricted directory is /
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
If the FTP server you are accessing accepts anonymous FTP accounts, and you want to log in as an anonymous user, use anonymous
as username and your email address as a password.
#linux