File based virtual user settings for Vsftpd on FreeBSD

Sunday, March 16th, 2008

I’ve done this before with the help of a very good blog entry. But when I tried to do the same thing today I can’t find that page. So I decide to write this down, in case I’ll need it later.

The most problem of setting up Vsftpd with file based virtual user on FreeBSD is that we don’t have pam_userdb. So we’ll use /usr/ports/security/pam_pwdfile instead.

So after installing the vsftpd and pam_pwdfile ports, do the following:

(1) in /etc/pam.d, make a file named “vsftpd” and put the following lines in it:

auth required /usr/local/lib/ pwdfile /etc/vsftpd_login.db
account required /usr/lib/

(2) make a password file with the apache htpasswd utility:

htpasswd -c -b /etc/vsftpd_login.db USERNAME PASSWORD

(3) make a local user with “nologin” as the shell and disable password login. I use “vsftp” for this.

(4) in /usr/local/etc/vsftpd.conf, disable anonymous access and enable local user access, and then add the following:




Note the value of “guest_usrname” is the local user name you made in step (3)

(5) make a directory /usr/local/etc/vsftpd, and write user specific configurations in a file named after the user’s login name. For example, someone with full write access will have something like this:


(6) It should be OK now, add vsftpd_enable=”YES” into /etc/rc.conf as usual, and restart vsftpd to see if everything works fine.

Tags: , , , , , , , , ,

Comments 42

  1. jose miguel wrote:

    I’ve tried to implement vsftpd using your recipe but I cannot log in with a valid user. The /var/log/messages file lists:
    vsftpd: in openpam_load_module(): no /usr/local/lib/ found
    The point is that I can list /usr/local/lib/

    Any idea?


    Posted 10 Dec 2009 at 10:40 pm
  2. Markus wrote:

    @Jose: I’ve got the same error. Seems to be a known issue in FreeBSD 8.0-RELEASE at the moment. This is very annoying concerning the fact that the module is not available in FreeBSD, either (which is how I do virtual users in Linux).

    @dryice: Nice tut, anyway. Thx.

    Posted 11 Mar 2010 at 7:58 am
  3. Markus wrote:

    Update: Problem solved!

    1. uninstall broken pam_pwdfile:
    pkg_delete pam_pwdfile-0.99

    2. Install pam_pwdfile from the ports:
    cd /usr/ports/security/pam_pwdfile
    make install clean

    3. Enjoy!

    (4. optionally also install vsftpd from the ports, since it is also a newer release)

    Posted 11 Mar 2010 at 8:30 am
  4. Kamagra Jelly wrote:

    Thanks for the post. I will give a try. Because it is quite hard to find information about it. I have been searching a lot and finally I found you page. I hope that I don’t problem with it.

    Posted 03 Nov 2010 at 11:47 pm
  5. Anna wrote:

    I recommend is to have several good watch …..
    They not only work fine and affordable …..
    Franck Muller Watches

    Posted 03 May 2011 at 2:08 pm
  6. buy lovegra wrote:

    Very nice post… Thanks for sharing this code. I would like to see more unique update from you.

    Posted 10 Jun 2011 at 2:40 pm
  7. generic viagra wrote:

    wow… Very useful information.. Your blog is very helpful for updating my knowledge. I will look forward for your future updates.

    Posted 10 Jun 2011 at 2:42 pm
  8. buy generic viagra wrote:

    This is really interesting information.Topic is is explained very well here.Thanks for your post.

    Posted 10 Jun 2011 at 2:45 pm
  9. Generic Viagra wrote:

    great information thanks for sharing this podt

    Posted 01 Aug 2011 at 3:41 pm
  10. Viagra Generic wrote:

    Thanks for sharing such a wonderful post..Loved reading each and every word!!

    Posted 05 Aug 2011 at 6:01 pm
  11. generic viagra wrote:

    that was nice to read,, thanks for sharing.. love to read that..

    Posted 19 Aug 2011 at 8:21 pm
  12. generic viagra wrote:

    This is very good article. Thanks for explaining about the topic in nice way. You have shared very nice information here.

    Posted 23 Aug 2011 at 11:47 am
  13. buy leather jacket wrote:

    I completely agree over your point and simply loved the topic that you choose. It is very straight and to the point, your thoughts and views are getting conveyed.

    Posted 26 Aug 2011 at 2:35 pm
  14. Buy Generic Viagra wrote:

    Great piece of information shared. Keep Posting..!!!

    Posted 05 Sep 2011 at 3:01 pm
  15. Generic levitra wrote:

    Excellent initiative!I like your blog posting… This is good posting information..

    Posted 20 Sep 2011 at 11:27 pm
  16. Generic Viagra wrote:

    You did a great work here. Thanks for sharing blog. Keep it up….

    Posted 21 Sep 2011 at 6:05 pm
  17. generic viagra wrote:

    Interesting Post, Vengeful Gladiator’s Leather Gloves equipped can interrupt Shade using their Deadly Throw ability.

    Posted 24 Sep 2011 at 7:37 pm
  18. Buy generic viagra wrote:

    Good post. I study something tougher on totally different blogs everyday. It should at all times be stimulating to learn content material from other writers and follow a bit something from their store

    Posted 26 Sep 2011 at 1:45 am
  19. Buy Dapoxetine 100mg wrote:

    Great post thanks and wonderful informative site.Thanks for sharing this interesting information and thank you very much………

    Posted 28 Sep 2011 at 11:32 pm
  20. Buy sildenafil wrote:

    Thanks for sharing this great article! I feel strongly about it and love learning more on this topic. It is extremely helpful for me. I hope you post again soon

    Posted 29 Sep 2011 at 6:50 pm
  21. Lingerie wrote:

    Good post. I study something tougher on totally different blogs everyday. It should at all times be stimulating to learn content material from other writers and follow a bit something from their store

    Posted 30 Sep 2011 at 2:57 pm
  22. buy generic viagra wrote:

    Excellent stuff written and shred by author..This post is very informative.Thanks!!

    Posted 01 Oct 2011 at 2:15 pm
  23. Generic viagra wrote:

    Thanks. I was needign this from a ong time. Your code had solevd my problem now.

    Posted 04 Oct 2011 at 1:17 am
  24. Generic Viagra wrote:

    These are amazing themes found here… Very interesting. Thanks a lot for the share.and very beautiful….

    Posted 15 Oct 2011 at 11:14 pm
  25. Generic Viagra wrote:

    I wonder how you got so good. This is really a fascinating blog, lots of stuff that I can get into. One thing I just want to say is that your Blog is so perfect!

    Posted 19 Oct 2011 at 2:47 pm
  26. generic viagra wrote:

    Great theme..I visit this blog regularly and every time i found something unique data..Amazing blog provided.Thanks!!

    Posted 25 Oct 2011 at 12:48 pm
  27. cheap generic viagra wrote:

    Wonderful theme..I think you given a most impressive articles..Thanks for sharing such a great blog.

    Posted 13 Jan 2012 at 2:23 pm
  28. Viagra online wrote:

    This is really interesting information.Topic is is explained very well here.Thanks for your post.

    Posted 14 Mar 2012 at 12:39 pm
  29. hosting services wrote:

    This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free.

    Posted 15 Mar 2012 at 8:17 pm
  30. David wrote:

    hi the option :
    seems dosen’t work i don’t know why?

    Posted 18 Dec 2013 at 12:22 am
  31. poul wrote:

    Processing is wonderful. The way you tell the thing is awesome. You are a master. Great blog!!! That was amazing your thought
    Generic Viagra

    Posted 09 Apr 2014 at 5:57 pm
  32. Smithb61 wrote:

    You are my inhalation, I have few blogs and sometimes run out from to brand. acdacabekcgfgdee

    Posted 01 May 2014 at 12:24 am
  33. Pharmd440 wrote:

    Very nice site!

    Posted 04 May 2014 at 9:37 am
  34. bimatoprost online wrote:

    Hello, I have browsed most of your recent posts. This post is where I got the most useful information for my research. Thanks for posting, maybe we can see more on this. Are you aware of any other websites on this subject.

    Posted 11 Aug 2014 at 8:53 pm
  35. buy modafinil online wrote:

    Be keen on to read it, looking forward of your more new Update and I regularly read your recent post its enormous Thanks. I would be obliged for this post. It’s tough to the good from the bad every so often, but I think you’ve spiked it! Please keep on updating your blog with more information.

    Posted 05 Sep 2014 at 6:11 pm
  36. Sildenafil Citrate wrote:

    Informative blog posted. Really liked reading this blog.

    Posted 30 Mar 2015 at 2:22 pm
  37. Sildenafil Citrate wrote:

    Appreciate for sharing such a great blog. Thank you for sharing it.

    Posted 16 Apr 2015 at 5:23 pm
  38. cheap generic viagra wrote:


    Posted 02 Jul 2015 at 8:25 pm
  39. Jessica Turner wrote:

    Very nice blog post……Thank you so much for sharing with us… Keep posting more……

    Generic Viagra

    Posted 16 Sep 2015 at 8:05 pm
  40. Ava Garey wrote:

    Informative blog posted. Really liked reading this blog.generic viagra

    Posted 06 Nov 2015 at 5:49 pm
  41. Philip Louis wrote:

    Such a ice and informative post. I defiantly suggest to my to read this post.
    For more information visit our webpage that contains Cheap Generic Viagra

    Posted 09 Feb 2016 at 6:07 pm
  42. Generic Viagra wrote:

    This post is very nice and i am really great full for sharing this post with us thanks.
    thanks and regards….

    Posted 10 Feb 2016 at 8:14 pm

Post a Comment

You could use <code type="name"> to get your code colorized

Your email is never published nor shared. Required fields are marked *

E-mail It