What Is an Anonymous FTP?

When using FTP, you must first log in. After obtaining the corresponding permissions on the remote host, you can upload or download files. In other words, if you want to transfer files with the same computer, you must have the proper authorization for which computer. In other words, you cannot transfer files unless you have a user ID and password. This situation violates the openness of the Internet. There are more than ten million FTP hosts on the Internet. It is impossible to require each user to have an account on each host. Anonymous FTP was created to solve this problem.

anonymous FTP
Anonymous
Anonymous FTP is a mechanism through which users can connect to remote
It is worth noting that anonymous FTP is not available for all Internet
The essence of anonymous FTP service is:
The advantages of anonymous FTP service are:
First, anonymous FTP is widely used without any specific requirements. So everyone can anonymously FTP
With anonymous FTP, users can log in to the FTP server without entering a username and password. After installing vsftpd, anonymous FTP is enabled by default. Users do not need to perform additional configuration to log in to the FTP server anonymously. The default values of the vsftpd related options are as follows:
anonymous_enable = YES // Enable anonymous FTP
dirmessage_enable = YES
xferlog_enable = YES
connect_from_port_20 = YES [2]
At this time, the user can log in to the FTP server anonymously, view and download all levels of subdirectories and files under the main directory of the anonymous account, but cannot upload files or create directories. Log in to the FTP server as follows:
#ftp localhost
Connected to localhost (127.0.0.1)
220 Welcome to Sam's Ftp Server
Name (localhost: root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files. [2]
List everything under the current directory as follows:
ftp> ls // List everything in the directory
227 Entering Passive Mode (127.0.0.1.183.106)
150 Here comes the directory listing.
drwxr-xr-x 2 0 0 4096 Oct 14 04:31 data
-rw-r--r-- 1 0 0 31 Oct 14 04:32 files.tar
-rw-r--r-- 1 0 0 26 Oct 14 04:32 hello.log
drwxr-xr-x 2 0 0 4096 Oct 14 04:33 pub
drwxr-xr-x 2 0 0 4096 Oct 14 04:33 src [2]
Go to the pub directory as follows:
ftp> cd pub // Enter the pub subdirectory
250 Directory successfully changed.
ftp> ls
227 Entering Passive Mode (127.0.0.1.111.125)
150 Here comes the directory listing.
-rw-r--r-- 1 0 0 23 Oct 14 04:33 sql.txt
-rw-r--r-- 1 0 0 20 Oct 14 04:33 sysadm.dmp
226 Directory send OK. [2]
Download the sql.txt file as follows:
ftp> get sql // Download sql.txt file
local: sql.txt remote: sql.txt
227 Entering Passive Mode (127.0.0.1.148.0)
150 Opening BINARY mode data connection for sql.txt (23 bytes).
226 File send OK.
23 byte received in 0.0001 seconds (2.1e + 02 Kbytes / s) [2]
Upload the top.log file as shown below.
ftp> put top.log // Failed to upload top.log file
local: top.log remote: top.log
227 Entering Passive Mode (127.0.0.1.155.93)
550 Permission denied [2]
Create the pub1 directory as follows:
ftp> mkdir pub1 // Failed to upload subdirectory
550 Permission denied. [2]
The above results are explained below:
(1) Name (localhost: root): anonymous: Anonymous login FTP server must use anonymous as the user account.
(2) ftp> ls: As with Linux systems, the ls command is used to list files and subdirectories under the current directory in FTP.
(3) ftp> cd pub: Enter the Pub directory.
(4) ftp> get sql.txt: Download the sql.txt file in the pub directory using an anonymous account.
(5) ftp> put top.log: upload the top.log file to the pub directory using an anonymous account, but the operation fails because the anonymous account is not allowed to upload files in the default configuration of vsftpd.
(6) ftp> mkdir pub1: Use the anonymous account to create the subdirectory pub1, but because the default configuration of sftpd does not allow anonymous accounts to create directories, the operation fails. [2]

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?