The FTP of Linux

Source: Internet
Author: User

An anonymous access-based FTP service

Anonymous account login is generally used to download the server, and does not require a user name and password, vsftpd default to turn on anonymous sharing, the default share path is/var/ftp/pub

1 Open port, turn off SELinux:

[Email protected] ~]# Vim/etc/selinux/config

Selinux=disabled

[Email protected] ~]# Setenforce 0

[[email protected] abc]# iptables-a input-p TCP--dport 20:21-j ACCEPT


2 Configuring the Anonymous FTP service

Installing the Software

[Email protected] abc]# yum-y install VSFTPD

[Email protected] pub]# rpm-q vsftpd

vsftpd-2.2.2-24.el6.i686


Create test files, modify directory permissions

[[email protected] ftp]# echo "This is FTP" >/var/ftp/pub/ftp.txt

[Email protected] ftp]# chown ftp/var/ftp/pub/#允许用户上传

[Email protected] ftp]# ll-d/var/ftp/pub

Drwxr-xr-x 2 FTP root 4096 May 19:06/var/ftp/pub


The configuration file remains the default and does not make any modifications.


Attached: Common options for anonymous service profiles:

Anonymous_enable=yes #允许匿名访问, when enabled, the default has read-only permissions to complete the download and other basic tasks

Local_enable=yes #启用本地用户

Write_enable=yes #开放服务器写权限, global options, to upload, you must turn on this

Anon_upload_enable=yes #允许匿名用户上传文件

Anon_mkdir_write_enable=yes #允许匿名用户创建目录


Open service

[[Email protected] vsftpd]# service VSFTPD start


3 Testing

In the Windows host Address bar, type: Ftp://IP


Two FTP services based on local accounts

VSFTPD can directly use the system user as an FTP account, provide login authentication based on username/password, when the user logs in using the system account, it will be in the host directory by default, and have read and write permissions in the host directory.

1 Open port, turn off SELinux (slightly)


2 Configuring the Local user FTP service

Installing the Software

[Email protected] abc]# yum-y install VSFTPD

[Email protected] pub]# rpm-q vsftpd

vsftpd-2.2.2-24.el6.i686


Creating system users and test files

[Email protected] vsftpd]# useradd-s/sbin/nologin Tom

[Email protected] vsftpd]# passwd Tom

Changing password for user Tom.

New Password:

Bad Password:it is the too short

Bad Password:is too simple

Retype new Password:

Passwd:all authentication tokens updated successfully.

[[email protected] tom]# echo "This is Tom" >/home/tom/tom.txt


Modifying a configuration file

[Email protected] tom]# vim/etc/vsftpd/vsftpd.conf

Anonymous_enable=no

Local_enable=yes

Write_enable=yes

local_umask=022

Dirmessage_enable=yes

Chroot_local_user=yes


Open service

[[Email protected] vsftpd]# service VSFTPD start


3 Testing

In the Windows host Address bar, type: Ftp://IP


4 Only allow Tom users to log in

[Email protected] zwj]# vim/etc/vsftpd/vsftpd.conf

Userlist_enable=yes

Userlist_deny=no

[Email protected] ~]# vim/etc/vsftpd/user_list

Tom

[Email protected] ~]# service VSFTPD Reload


5 test again Tom User: ftp://[email protected]




This article from "10,000 years too long, seize" blog, please be sure to keep this source http://zengwj1949.blog.51cto.com/10747365/1930770

The FTP of Linux

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.