Article Title: vsftpd can only be uploaded and viewed, but cannot be downloaded. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
A friend asked me to help set up ftp a few days ago. The requirement was that the file could only be uploaded but not downloaded during browsing. Initially, this permission cannot be implemented based on general permissions, because browsing and downloading are a permission and cannot be distinguished. My friend said that it was just a meal, and it was a bit of motivation. He planned to try it and it should be possible because there were many unexpected things in linux. As a result, google finds the method and can control the user's ftp commands, which is simple. I found a configuration file on the Internet that can meet my needs. I cannot perform a test. I 'd like to write it myself.
OK, test is successful.
Attached instructions:
Vsftpd. conf file:
Connect_from_port_20 = YES
Anonymous_enable = NO
Write_enable = YES
Local_umask = 002
Listen_port = 21
Listen = YES
Pasv_enable = YES
Use_localtime = YES
Connect_timeout = 60
Accept_timeout = 60
Data _ connection_timeout = 600
Local_enable = YES
Cmds_allowed = ABOR, CMD, LIST, MDTM, MKD, NLST, PASS, PASV, PORT, PWD, QUIT, SIZE, STOR, TYPE, USER
Chroot_list_enable = YES
Chroot_list_file =/etc/vsftpd. chroot. list
Pam_service_name = vsftpd
Xferlog_enable = YES
Xferlog_file =/var/log/vsftpd. log
Note the cmds_allowe section.
The following is a description of the related commands:
(Note that there cannot be line breaks or spaces in this line)
# ABOR-abort a file transfer cancel file transfer
# CWD-change working directory change directory
# DELE-delete a remote file delete an object
# LIST-list remote files column directory
# MDTM-return the modification time of a file
# MKD-make a remote directory to create a folder
# NLST-name list of remote directory
# PASS-send password
# PASV-enter passive mode
# PORT-open a data port open a transmission PORT
# PWD-print working directory: displays the current working directory
# QUIT-terminate the connection to exit
# RETR-retrieve a remote file download file
# RMD-remove a remote directory
# RNFR-rename from
# RNTO-rename
# SITE-site-specific commands
# SIZE-return the size of the file returned by a file
# STOR-store a file on the remote host
# TYPE-set transfer type
# USER-send username
Choose as needed. vsftpd is really powerful. I only use vsftpd for ftp. Haha!