PureFTPD installation memo

Source: Internet
Author: User
PureFTPD installation memo is only used internally, so Mysql is not enabled. in the PureDB mode, Pureftp has a very useful function. during compilation, append & amp; ndash; with-virtualchroot can let the user break through the chroot, which can implement virtual machines like serv-u or g6 on win... pureFTPD installation memo is only used internally, so Mysql is not enabled. the Pureftp method in PureDB has a very useful function. during compilation, adding-with-virtualchroot will allow users to break through the chroot, in this way, you can implement virtual directories like serv-u or g6 on win without the need to mount them, write a simple script to automatically install and install puureftp. put the execution files and documents in the/usr/local/pureftpd configuration file in the/etc/pureftpd file to automatically add the pureftpd service and set it to boot. the startup script is as follows: #! /Bin/bashver = 1.0.30sbindir =/usr/local/pureftpdetcdir =/etc/pureftpd cd/usr/local/srcwget ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd- Unzip ver.tar.gz tar zxvf pure-ftpd-1_ver.tar.gz cd pure-ftpd-$ ver. /configure -- with-altlog -- with-puredb -- with-extauth -- with-cookie -- with-throttling -- with-ftpwho -- with-ratios -- with-quotas -- with-welcomemsg -- -uploadscript -- with-virtualhosts -- with-virtualchroot -- with-diraliases -- with-peruserlimits -- with-rfc2640 -- with-language = simplified-chinese -- prefix = $ sbindir -- sysconfdir = $ etcdirmakemak E installcp configuration-file/pure-config.pl $ sbindir/sbin/chmod 755 $ sbindir/sbin/pure-config.plmkdir-p $ etcdircp configuration-file/pure-ftpd.conf $ etcdir/cp contrib/redhat. init/etc/init. d/pureftpd sed-I's #/usr/local/sbin/# '$ sbindir'/sbin/# g'/etc/init. d/pureftpdsed-I's #/usr/local/sbin/pure-ftpwho # '$ sbindir'/sbin/pure-ftpwho # g'/etc/init. d/pureftpdsed-I's #/etc/pure-ftpd.conf # '$ etcdir'/p Ure-ftpd.conf # g'/etc/init. d/pureftpdchmod 755/etc/init. d/pureftpdchkconfig -- add pureftpdchkconfig pureftpd on echo PATH = $ PATH: /usr/local/pureftpd/bin/>/etc/profilesource/etc/profilesed-I's $ # PureDB/etc/pureftpd. pdb $ PureDB/etc/pureftpd. pdb $ G' $ etcdir/pure-ftpd.conf to prevent some software from automatically scanning port 21, we tend to change FTP's default port 21 to another port greater than 1024, such as 21221 changing pureftpd. conf Bind 0.0.0.0, 21221 PassivePortRange 50000 50100 # You may only need to open a small part of the port. if iptables is enabled on the server, open/etc/sysconfig/iptables-config to ensure that ip_conntrack_ftp is loaded in the file definition, for example: IPTABLES_MODULES = "ip_conntrack_ftp" and then in the file/etc/modprobe. conf adds the parameter of this module: options ip_conntrack_ftp ports = 2121 restart the iptables service to create a user management script for the user management script, but it is not as comprehensive as the following writing. author: deccmtd #! /Bin/bash ### functions: Pureftpd script # author: Hu ShuangFeng # version 1.0: 2010-08-10. # FTP =/usr/local/pureftpd/bin/pure-pw mkpasswd = 'mkpasswd-l 22-d 5-C 5>/tmp/pureftpdoo 'passwd1 = 'SED '1 w/tmp/pureftpdoo1 '/tmp/pureftpdoo' passwd2 = 'cat/tmp/pureftpdoo>/tmp/pureftpdoo1 'passwd =/tmp/pureftpdoo1while echo "==== = ========================== "do printf" What Are You Doing? /N/n1: UserAdd/n2: UserMod/n3: UserPasswd/n4: UserDel/n5: ListAllUser/n6: ListOneUser/n7: List And Delete User/n8: ShowUser/nq: exit/n ======================================== /nEnter number: "; read number while [" $ number "! = "1"] & ["$ number "! = "2"] & ["$ number "! = "3"] & ["$ number "! = "4"] & ["$ number "! = "5"] & ["$ number "! = "6"] & ["$ number "! = "Q"] & ["$ number "! = "7"] & ["$ number "! = "8"] & ["$ number "! = "9"] & ["$ number "! = ""] Do printf "Please enter the correct option:"; read number done case "$ number" in 1) printf "Please Enter a user name :"; read name printf "/nYou directory is ['pwd']? /NPlease confirm/"yes/" or/"no/": "; read dddd while [" $ dddd "! = "Yes"] & ["$ dddd "! = "No"] & ["$ dddd "! = "Y"] & ["$ dddd "! = "N"] & ["$ dddd "! = ""] Do printf "Please enter the correct option/" yes/"or/" no/":"; read dddd done case "$ dddd" in y) $ FTP useradd $ name-u nobody-g nobody-d 'pwd'-m <$ passwd echo "-----------------------------------" echo "" echo "Users [$ name] create successful! "Echo" "printf" You user name is: $ name/n "printf" You Password is: $ passwd1/n "printf" You directory is: 'pwd'/n "echo" "; yes) $ FTP useradd $ name-u nobody-g nobody-d 'pwd'-m <$ passwd echo "-----------------------------------" echo "" echo "Users [$ name] create successful! "Echo" "printf" You user name is: $ name/n "printf" You Password is: $ passwd1/n "printf" You directory is: 'pwd'/n "echo" "; n) printf" Please enter the directory :"; read directory while ['echo "$ directory" | grep "^/" | wc-L '! = "1"] do printf "Please enter the correct directory :"; read directory done $ FTP useradd $ name-u nobody-g nobody-d $ directory-m <$ passwd echo "---------------------------------" echo "" echo "Users [$ name] create successful! "Echo" "printf" You user name is: $ name/n "printf" You Password is: $ passwd1/n "printf" You directory is: $ directory/n "echo" "; no) printf" Please enter the directory :"; read directory while ['echo "$ directory" | grep "^/" | wc-L '! = "1"] do printf "Please enter the correct directory :"; read directory done $ FTP useradd $ name-u nobody-g nobody-d $ directory-m <$ passwd echo "---------------------------------" echo "" echo "Users [$ name] create successful! "Echo" "printf" You user name is: $ name/n "printf" You Password is: $ passwd1/n "printf" You directory is: $ directory/n "echo" "; esac; 2) printf" Please enter a user name: "; read name printf" Please enter a new directory :"; read newdirectory $ FTP usermod $ name-u nobody-g nobody-d $ newdirectory-m echo "-----------------------------------" echo "" echo "User [$ name] modify a su Ccessful! "Echo" "printf" You user name is: $ name/n "printf" You new directory is: $ newdirectory/n "echo" "; 3) printf "Please enter a user name:"; read name $ FTP passwd $ name-m <$ passwd echo "---------------------------------" echo "" echo "[$ name] Password changed successfully! "Echo" "printf" You user name is: $ name/n "printf" You nwe password is: $ passwd1/n "echo" "; 4) printf "Please enter a user name:"; read name $ FTP userdel $ name-m echo "-------------------------------------" echo "" printf "You want to delete [$ name]? /N/"yes/" or/"no/": "; read yesno while [" $ yesno "! = "Yes"] & ["$ yesno "! = "No"] & ["$ yesno "! = "Y"] & ["$ yesno "! = "N"] do printf "Please enter the correct option/" yes/"or/" no/":"; read yesno done case "$ yesno" in y) $ FTP userdel $ name-m echo "---------------------------------" echo "" Users [$ name] have been deleted! "Echo" "; yes) $ FTP userdel $ name-m echo" ----------------------------------- "echo" echo "Users [$ name] have been deleted! "Echo" "; esac; 5) $ FTP list; 6) printf" Please enter a user name :"; read name $ FTP list | grep $ name echo ""; 7) printf "Please enter a user name :"; read name $ FTP list | grep $ name echo "-------------------------------------" echo "" printf "You want to delete [$ name]? /N/"yes/" or/"no/": "; read yesno while [" $ yesno "! = "Yes"] & ["$ yesno "! = "No"] & ["$ yesno "! = "Y"] & ["$ yesno "! = "N"] do printf "Please enter the correct option/" yes/"or/" no/":"; read yesno done case "$ yesno" in y) $ FTP userdel $ name-m echo "---------------------------------" echo "" Users [$ name] have been deleted! "Echo" "; yes) $ FTP userdel $ name-m echo" ----------------------------------- "echo" echo "Users [$ name] have been deleted! "Echo" "; esac; 8) printf" Please enter a user name: "; read name $ FTP show $ name echo" "; q) exit; esacdone

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.