Build a ProFTPd server in Ubuntu

Source: Internet
Author: User
Tags reverse dns
Introduction front-end engineers are required to test the environment, but most front-end engineers do not need Linux. After debugging, I am a part-time O & M engineer, therefore, building an FTP server facilitates front-end engineers to deploy and debug their own code to build a ProFTPd server and install ProFTPd.
sudo apt-get install proftpd

Configure ProFTPD
vim /etc/proftpd/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to # 'proftpd. conf 'for actual use. it establishes a single server # And a single anonymous login. it assumes that you have a user/group # "nobody" and "ftp" for normal operation and anon. servername "hao_geek_team" serverident offservertypestandalonedefaaddressip1 ip2 ip3socketbindtighton # port 21 is the standard FTP port. port21 # umask 022 is Good standard umask to prevent new dirs and files # from being group and world writable. umask022 # To prevent DoS attacks, set the maximum number of child processes # to 30. if you need to allow more than 30 concurrent connections # at once, simply increase this value. note that this only works # in standalone mode, in inetd mode you shoshould use an inetd server # that allows you to limit maximum number Of processes per service # (such as xinetd ). maxinstances30 # Set the user and group under which the server will run. usergeekgroupgeek # To cause every FTP user to be "Jailed" (chrooted) into their home # directory, uncomment this line. defaultroot ~ Allowoverwriteyes # normally, we want files to be overwriteable. <directory ~ /Incoming> <limit write> allowuser lczhftpdenyall </limit> </directory> <directory ~> <Limit read dirs> allowuser lczhftpallowuser filemanagerallowuser kfxallowuser lsyallowuser yanglidenyall </limit> <limit write> denyall </limit> </directory> # sets the client authentication method, use the file authentication authorder mod_auth_file.c mod_auth_unix.c # specify the file authentication passwd file authuserfile/etc/ProFTPD/FTP. passwd # specify the file-authenticated group file authgroupfile/etc/ProFTPD/FTP. group # The authenticated account does not need a valid shellrequirevalidshell off # sets the number of connection requests received per second to prevent DoS attacks maxconnectionrate 5 # the maximum number of clients connected to maxclients 20 "sorry, the maximum number of allowed users (% m) are already connected. "# Allow the endpoint to resume allowstorerestart on # disable reverse DNS resolution usereversedns offidentlookups off
Ftpasswd creates an access user
sudo ftpasswd --passwd --file=/etc/proftpd/ftp.passwd --name=wangzhengyi --uid=33 --shell=/bin/false --home=/home/nohome

The definition of each parameter can be man. If you completely copy me, I can only say that your O & M is too stupid. It is necessary to think about your own needs!

Restart the ProFTPd Server
sudo  /etc/init.d/proftpd  restart

For the purpose of ProFTPD permission control, different users need different root directories. The directory structure is as follows: -- root (root directory): -- test1 (subdirectory 1) -- Test2 (subdirectory 2) -- test3 (subdirectory 3) has three users: user1, user2, user3. user1 is under the/root directory by default, and user1 is under the/root/test1 directory by default, user2 defaults to the/root/Test2 directory implementation method (1) set the Home Directory of user1 to/root, and the home directory of user1 to/home/test1, the Home Directory of user2 is/home/Test2. The setting method is as follows:

sudo ftpasswd --passwd --file=/etc/proftpd/ftp.passwd --name=wangzhengyi --uid=33 --shell=/bin/false --home=/root{ /test1 /test2}

(2) Add permission Control

DefaultRoot /root<Directory /root/test1><Limit WRITE>AllowUser user1DenyAll</Limit></Directory><Directory /root/test2><Limit WRITE>AllowUser user2DenyAll</Limit></Directory>
After a working user logs on to the FTP server, proftpd first searches for the/home directory of the System user by default and compares the directory with ProFTPD. the configuration in the conf file is matched. If no match exists, go to ProFTPD. use the defaultroot command in the conf file to log on to the default root directory of the server. Click the link to open the link.

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.