Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 23579  / 3 Years ago, fri, september 24, 2021, 5:10:43

The process I have used for installing vsftpd since 12.04 no longer works. I get the error stop: Unknown instance when restarting the service. I believe this means the configuration is wrong, but I cannot track down the issue. I'm having this problem on a virtual server.



Additionally, running sudo vsftpd results in 500 OOPS: munmap as noted by @Beltran.







  1. Acquire root privileges



    sudo -s

  2. Install vsftpd and libpam-pwdfile



    apt-get install vsftpd libpam-pwdfile

  3. Edit vsftpd.conf



    mv /etc/vsftpd.conf /etc/vsftpd.conf.bak
    vim /etc/vsftpd.conf


    Copy and paste the following lines.



    allow_writeable_chroot=YES
    anonymous_enable=NO
    chroot_list_enable=YES
    chroot_local_user=YES
    guest_enable=YES
    guest_username=vsftpd
    hide_ids=YES
    listen=YES
    local_enable=YES
    local_umask=022
    local_root=/var/clients/$USER
    nopriv_user=vsftpd
    pasv_address=127.0.0.1
    pasv_enable=YES
    pasv_min_port=65000
    pasv_max_port=65100
    port_enable=YES
    user_sub_token=$USER
    seccomp_sandbox=NO
    virtual_use_local_privs=YES
    write_enable=YES

  4. Register virtual admin



    apt-get install apache2-utils
    mkdir /etc/vsftpd
    htpasswd -cd /etc/vsftpd/ftpd.passwd admin
    vim /etc/vsftpd.chroot_list


    Add 1 line for the admin user



    admin

  5. Configure PAM



    mv /etc/pam.d/vsftpd /etc/pam.d/vsftpd.bak
    vim /etc/pam.d/vsftpd


    Copy and paste these 2 lines.



    auth required pam_pwdfile.so pwdfile /etc/vsftpd/ftpd.passwd
    account required pam_permit.so

  6. Create a local user without shell access



    useradd --home /home/vsftpd --gid nogroup -m --shell /bin/false vsftpd

  7. Create root directory and give local user proper access.



    mkdir /var/clients
    chmod -R 755 /var/clients
    chown -R vsftpd:nogroup /var/clients

  8. Register jailed virtual users (initially, I skip this step)



    htpasswd -d /etc/vsftpd/ftpd.passwd {user_name}
    mkdir /var/clients/{user_name}

  9. Restart service



    service vsftpd restart


More From » 14.04

 Answers
2

If you're receiving this issue on an AWS EC2 instance, you should try creating the instance with HVM virtualization instead of the Paravirtual.



If you still desire a paravirtual instance, there no telling when the bug will be fixed as it is a bug in the Xen kernal, which is used to run virtualization for AWS.



Here is the bug thread addressing this issue in more detail:
https://bugs.launchpad.net/ubuntu/+source/vsftpd/+bug/1313450


[#25750] Saturday, September 25, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ledeball

Total Points: 434
Total Questions: 121
Total Answers: 120

Location: Antigua and Barbuda
Member since Sat, Apr 24, 2021
3 Years ago
;