LINUX-FTP Server vsftpd Create virtual user

Source: Internet
Author: User

Install package: Yum install-y vsftpdvim/etc/vsftpd/vsftpd.conf

Anonymous_enable=no # do not allow anonymous users to log on

Local_enable=yes # allow local users to log on

Write_enable=yes # Write permission

local_umask=077 # umask value for local user-created files

Anon_upload_enable=no # do not allow anonymous users to upload

Anon_mkdir_write_enable=no # do not allow anonymous users to create directories

Dirmessage_enable=yes #当用户进入某个目录时, the contents of this directory will be displayed , and the file displayed by default is ". Message"

Xferlog_enable=yes # indicates that the upload and download of the record is written in the file specified by xferlog_file

Connect_from_port_20=yes # Active mode data transfer interface

Chown_uploads=yes # If enabled, ownership of all anonymous upload files will be changed to the user specified in chown_username

Chown_username=virtualuser

Xferlog_file=/var/log/xferlog

Xferlog_std_format=yes #传输日志文件将以标准xferlog in written form

IDLE_SESSION_TIMEOUT=600 # Idle session Interrupt Time

data_connection_timeout=120 #表明数据连接超时时间为 s

Ftpd_banner=welcome # First Sign-in prompt message

Chroot_local_user=yes # Restrict all users to the home directory

Chroot_list_enable=no # All users are restricted to the home directory, and the exceptions in chroot_list are not allowed

#chroot_list_file =/etc/vsftpd/chroot_list

Listen=yes # Enable listening mode

Listen_ipv6=no # Enable IPv6 listening mode, mutually exclusive with listen

PAM_SERVICE_NAME=VSFTPD the profile name used by the authentication service provided by the #PAM module

Userlist_enable=yes # prohibit Login to user name in userlist_file specified file

Tcp_wrappers=yes # Host access Control

Allow_writeable_chroot=yes

Anon_other_write_enable=no # do not allow anonymous user modification

Anon_world_readable_only=no # do not allow anonymous users to download

Delete_failed_uploads=true # Delete upload failed files

Dirlist_enable=yes # Allow directory list to be displayed

Download_enable=yes # allow download

Local_root=/home/virtualuser #FTP root directory

anon_max_rate=1048576 # Anonymous user maximum transfer rate ( bytes / sec ),0 for Unrestricted

local_max_rate=1048576 # Local User maximum transfer rate ( bytes / sec ) ,0 is unrestricted

anon_umask=022 # umask value for anonymous user-created files

Max_login_fails=3 #3 Logon failure terminating session

MAX_PER_IP=10 # Limit the number of concurrent connections to clients

Pasv_enable=yes # Turn on Passive mode

PASV_MIN_PORT=24500 # Passive mode min Port

PASV_MAX_PORT=24600 # Passive mode maximum port

LISTEN_ADDRESS=192.168.200.101 # Listening address

guest_enable=yes# turning on virtual users

Virtual_use_local_privs=yes

Virtual user has Write permissions when #当virtual_use_local_privs =yes,write_enable=yes

Guest_username=virtualuser #虚拟用户对应系统用户

Create a virtual user

Useradd-s/sbin/nologin Virtualuser

Systemctl Start VSFTPD

Systemctl Enable VSFTPD

Edit Virtual user account password

Vim/etc/vsftpd/virtualuser

User123
123
user456
456

Generate a virtual user data file

Db_load-t-T Hash-f/etc/vsftpd/virtualuser/etc/vsftpd/virtualuser.db

Delete a file with an account password

Rm-f/etc/vsftpd/virtualuser

Modify the authentication method (comment out all content, add the following content)

Auth sufficient/lib64/security/pam_userdb.so Db=/etc/vsftpd/virtualuser
Account Sufficient/lib64/security/pam_userdb.so Db=/etc/vsftpd/virtualuser

OOPS:vsftpd:refusing to run with writable root inside chroot () Error Resolution

In the vsftpd configuration file, add:

Allow_writeable_chroot=yes or:

chmod 555 virtualroot/# remove ftp directory Write permissions

LINUX-FTP Server vsftpd Create virtual user

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.