VSFTP usage summary

Source: Internet
Author: User
System environment: Ubuntu10.04LTSdesktop, Ubuntu10.04LTSserver Summary: 1. after downloading $ sudoapt-getinstallvsftpd to install vsftp anonymously, an ftp user group and a reorganization will be automatically created...

 

System environment:

 

Ubuntu 10.04LTS desktop and Ubuntu 10.04LTS server

 

Summary:

 

1. anonymous download

 

 

$ Sudo apt-get install vsftpd

$ Sudo apt-get install vsftpd

After vsftp is installed, an ftp user group and a user named ftp are automatically created. The main directory of the user is/srv/ftp. The owner of this directory is the user ftp, and ftp has the rwx permission on this directory

 

In this case, you only need to add anonymous_enable = YES to/etc/vsftpd. conf. other configurations keep the default Ubuntu value and execute

 

 

$ Sudo/etc/init. d/vsftpd restart

$ Sudo/etc/init. d/vsftpd restart

Restart the vsftp service to access ftp anonymously and download files.

 

If other configuration information is changed, make sure that the configuration is correct (for example, after setting the log file path, make sure there is a log file in the corresponding directory, otherwise, you must manually create an empty file.) the file cannot conflict with anonymous_enable = YES.

 

After an afternoon of hard work, we found that the four bold points were the key to setting up anonymous downloads.

 

2. logs

 

Default vsftp logs are stored in/var/log/vsftpd. log.

 

3. add a user

 

To add an ftp user, follow these steps:

 

For example, add a user named upload whose main directory is/srv/ftp/upload. the default shell is sh, which belongs to the ftp user group and needs to be executed:

 

 

$ Sudo useradd-d/srv/ftp/upload-s bin/sh-g ftp upload

$ Sudo useradd-d/srv/ftp/upload-s bin/sh-g ftp upload add a line to the vsftp configuration file

 

Unpriv_user = upload)

 

And one line

 

Local_enable = YES

 

Ensure that the upload user is the owner of the main directory:

 

 

$ Sudo usermod-d/srv/ftp/upload

$ Sudo usermod-d/srv/ftp/upload upload4, umask

 

The default umask value of vsftp is 077, which means that the file uploaded by one user cannot be downloaded by other users. if you want to change the umask value, you can add a line to the vsftp configuration file.

 

Local_umask = [umask to be set]

 

5. Mount

 

If another disk volume or virtual volume group is attached to a directory in the ftp directory (I mount the pub directory to a virtual volume Group, in this way, you can dynamically increase space, strip, and redundancy). pay attention to setting automatic mounting upon startup. Otherwise, the default ubuntu server will be shut down and the Mount point will be uninstalled, next boot, pub will have an empty directory.

 

At the same time, do not mount the root directory of the ftp user. after being mounted, the owner of the directory becomes root and cannot be changed.

 

6. copy an object

 

Copy all files and subdirectories in a directory and run the following command:

 

 

$ Cp-a [directory name]/* [destination directory]

$ Cp-a [directory name]/* [Target Directory] during aix training, the instructor said that cp and rm are more efficient than mv, but I don't feel it when I move more than 30 GB of files on ubuntu. maybe the files I copied are incomplete .. However, as long as the disk space is sufficient, cp is more practical.

 

From bhq's nest in CSDN

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.