Vsftp + Pam virtual account quick configuration script

Source: Internet
Author: User
Vsftp + Pam virtual account quick script test environment configuration: Centos6.2x64www. 2cto. comftp Upload Directory:/var/www/htmlvsftpd configuration file directory:/etc/vsftpd/Virtual User configuration file directory:/etc/vsftpd/user_conf/01 #! /Bin/bash02 # c... vsftp + Pam virtual account quick configuration script test environment: Centos 6.2x64 www.2cto.com ftp upload Directory:/var/www/html vsftpd configuration file directory: /etc/vsftpd/Virtual User configuration file directory:/etc/vsftpd/user_conf/01 #! /Bin/bash02 # cqyzs@live.com03yum install-y vsftpd db4 db4-devel db4-utils04mkdir-p/var/www/html05useradd-d/var/www/html-s/sbin/nologin-g root ftpuser06touch/ etc/vsftpd/vusers07echo "Enter username password: "08 read NAME PASSWD09echo $ NAME>/etc/vsftpd/vusers10echo $ PASSWD>/etc/vsftpd/vusers11db_load-T-t hash-f/etc/vsftpd/vusers/etc /vsftpd/login. db12chmod 600/etc/vsftpd/login. db13rm-f/etc/vsftpd/vusers14touch/etc/pam. d/virtualusers15echo "auth required/lib64/security/pam_userdb.so db =/etc/vsftpd/login">/etc/pam. d/virtualusers16echo "account required/lib64/security/pam_userdb.so db =/etc/vsftpd/login">/etc/pam. d/virtualusers17mkdir-p/etc/vsftpd/user_conf18touch/etc/vsftpd/user_conf/$ NAME19echo "local_root =/var/www/html">/etc/vsftpd/user_conf/$ NAME20echo "write_enable = YES">/etc/vsftpd/user_conf/$ NAME21echo "placement = NO">/etc/vsftpd/user_conf/$ NAME22echo "anon_upload_enable = YES"> /etc/vsftpd/user_conf/$ NAME23echo "success = YES">/etc/vsftpd/user_conf/$ NAME24echo "anon_other_write_enable = YES">/etc/vsftpd/user_conf/$ NAME25cp/etc/vsftpd. conf/etc/vsftpd. conf. bak26cat/dev/null>/etc/vsftpd. conf27echo "guest_enable = YES">/etc/vsftpd. conf28echo "guest_username = ftpuser">/etc/vsftpd. conf29echo "anonymous_enable = NO">/etc/vsftpd. conf30echo "anon_mkdir_write_enable = NO">/etc/vsftpd. conf31echo "anon_other_write_enable = NO">/etc/vsftpd. conf32echo "chroot_local_user = YES">/etc/vsftpd. conf33echo "virtual_use_local_privs = YES">/etc/vsftpd. conf34echo "local_umask = 022">/etc/vsftpd. conf35echo "file_open_mode = 0777">/etc/vsftpd. conf36echo "user_config_dir =/etc/vsftpd/user_conf">/etc/vsftpd. conf37echo "local_enable = YES">/etc/vsftpd. conf38echo "write_enable = NO">/etc/vsftpd. conf39echo "dirmessage_enable = YES">/etc/vsftpd. conf40echo "xferlog_enable = YES">/etc/vsftpd. conf41echo "xferlog_file =/var/log/vsftpd. log ">/etc/vsftpd. conf42echo "connect_from_port_20 = YES">/etc/vsftpd. conf43echo "xferlog_std_format = YES">/etc/vsftpd. conf44echo "listen = YES">/etc/vsftpd. conf45echo "pam_service_name = virtualusers">/etc/vsftpd. conf46echo "userlist_enable = YES">/etc/vsftpd. conf47echo "tcp_wrappers = YES">/etc/vsftpd. conf48chown ftpuser: root/var/www/html49service vsftpd restart

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.