Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I have implemented vsftpd using the following site centosforserver.blogspot.in/2010/02/virtual-hosting-with-vsftpd-and-mysql.html]VSFTPD Virtual users configuration (with MySQL) CentOS 5.x / RHEL 5 - HowTO example - CentOS linux server - VSFTPd virtual ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2013
    Posts
    32

    Post Vsftpd virtual users mapping issue


    Hi,

    I have implemented vsftpd using the following site
    centosforserver.blogspot.in/2010/02/virtual-hosting-with-vsftpd-and-mysql.html]VSFTPD Virtual users configuration (with MySQL) CentOS 5.x / RHEL 5 - HowTO example - CentOS linux server - VSFTPd virtual users MySQL configuration[/url]. It worked fine for me but in my setup I have a small deviation, Lets say I have a virtual user A having home directory as /home/A and I have a virtual user B and I need to map his home directory as /home/A instead of his home directory /home/B. How to do this. Any suggestions will be highly appreciated.

    vsftpd.conf FILE

    # No ANONYMOUS users allowed
    anonymous_enable=NO
    # Allow 'local' users with WRITE permissions (0755)
    local_enable=YES
    write_enable=YES
    local_umask=022
    dirmessage_enable=YES
    xferlog_enable=YES

    # if you want to LOG vsftpd activity then uncomment this log_ftp_protocol
    # log_ftp_protocol=YES

    connect_from_port_20=YES

    # uncomment xferlog_file and xferlog_std_format if you DIDN'T use the line above
    # with log_ftp_protocol - it must be excluding each other
    # The name of log file when xferlog_enable=YES and xferlog_std_format=YES
    # WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
    #xferlog_file=/var/log/xferlog
    #
    # xferlog_std_format Switches between logging into vsftpd_log_file and xferlog_file files.
    # NO writes to vsftpd_log_file, YES to xferlog_file
    # xferlog_std_format=YES

    #
    # You may change the default value for timing out an idle session (in seconds).
    #idle_session_timeout=600
    #
    # You may change the default value for timing out a data connection (in seconds).
    #data_connection_timeout=120
    #
    # define a unique user on your system which the
    # ftp server can use as a totally isolated and unprivileged user.
    nopriv_user=vsftpd

    chroot_local_user=YES

    listen=YES

    # here we use the authentication module for vsftpd to check users name and passw
    pam_service_name=vsftpd
    userlist_enable=YES
    tcp_wrappers=YES

    # If userlist_deny=YES (default), never allow users in this file
    # /etc/vsftpd/user_list , and do not even prompt for a password.
    # Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
    # for users that are denied.
    userlist_deny=yes

    # here the vsftpd will allow the 'vsftpd' user to login into '/home/vsftpd/$USER directory
    guest_enable=YES
    guest_username=vsftpd
    local_root=/home/vsftpd/$USER
    user_sub_token=$USER
    virtual_use_local_privs=YES
    user_config_dir=/etc/vsftpd/vsftpd_user_conf

    force_local_data_ssl=NO
    force_local_logins_ssl=NO

    # PASV - passive ports for FTP (range 44000 - 44100 ; 100 PASV ports, OPEN FIREWALL FOR ALLOWING CONNECTIONS
    pasv_enable=YES
    pasv_min_port=44000
    pasv_max_port=44100

    ssl_tlsv1=YES
    ssl_sslv2=YES
    ssl_sslv3=YES


    The old setup is based on system based accounts and I have migrated to virtual users using this article. In that they have mapped one home directory for two users. I have to do the same setup in the new implementation.

    Thanks in advance
    Andy

  2. #2
    Linux Newbie
    Join Date
    Jan 2013
    Posts
    116
    Hi Andy,

    Do you want to change home directory for user B as /home/B to /home/A you can do it as below:

    #usermod -d /home/A B
    Thanks,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •