FTP Service setup under Linux

Source: Internet
Author: User

1. Configuration
/etc/passwd
/etc/group

/etc/vsftpd/vsftpd.conf #配置文件
/USR/SBIN/VSFTPD #主程序
/etc/vsftpd/ftpusers #黑名单, you cannot log in to the FTP server as long as this list
/etc/vsfptd/user_list #控制用户登录
/var/ftp #匿名用户主目录

#配置锁定用户只能在家目录活动, two options are enabled at the same time to take effect
Chroot_list_enable=yes
Chroot_list_file=path #注意在PATH文件中添加要限制的用户名

#关于 User_list and Ftpusers in the/ETC/VSFTPD directory
Userlist_enable=no User_list does not take effect
Userlist_enable=yes userlist_deny=yes file User_list user cannot log in
Userlist_enable=yes Userlist_deny=no White List

2. Command
#vim. netrc
Machine host1 login mislost password 123456
#ftp host1
-N Disables automatic login and requires a user name password to be entered manually

Use! Execute local shell

ftp-s filename #执行filename中的命令

FTP << EOF
...
Eof

3. Error messages
2.. #成功
3.. #权限问题
4.. #文件问题
5.. #服务器问题

4. Virtual Users
Generate a virtual user password vault file
#创建login. txt write to login passwd
Configure the authentication file to generate VSFTPD
#db_load-T-t hash-f login.txt/etc/vsftpd/vsftpd_login.db
#若无db_load Yum Install db4*
#chmod 600/etc/vsftpd/vsftpd_login.db
#vim/etc/pam.d/vsftpd
#注释所有内容 Add the following two lines
Auth required/lib/security/pam_userdb.so Db=/etc/vsftpd/vsftpd_login
Account Required/lib/security/pam_userdb.so Db=/etc/vsftpd/vsftpd_login
Establish access rights for virtual users
#useradd-D/home/ftp Virtual
#chmod 700/home/ftp
Setting up a configuration file
#vim/etc/vsftpd/vsftpd.conf
Local_enable=yes
Guest_enable=yes #启用虚拟用户
Guest_username=virtual #映射到本地virtual用户
Service VSFTPD Restart

5. Virtual FTP Service
Create virtual FTP Server root directory
Mkdir-p/var/newftp/newpub
chmod 755/var/newftp-r
Adding anonymous users to virtual FTP servers
useradd-d/var/newftp-m newftp
Create a configuration file for a virtual FTP server
Cp/etc/vsftpd/vsftpd.conf/etc/vsfptd/vsftpd2.conf
Listen=yes
listen_address=192.168.1.114 #绑定ip WTF?????
#ifconfig eth0:0 192.168.1.214 up
Ftp_username=newftp
Service VSFTPD Restart

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

FTP Service setup under 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.