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/pam_pwdfile.so pwdfile /etc/vsftpd_login.db
account required /usr/lib/pam_permit.so

(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:

/usr/chroot_local_user=YES
guest_enable=YES
guest_username=vsftp
listen=YES
background=YES

pam_service_name=vsftpd

user_config_dir=/usr/local/etc/vsftpd
virtual_use_local_privs=YES

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:

anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
write_enable=YES

(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 58

  1. jose miguel wrote:

    Hi.
    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/pam_pwdfile.so found
    The point is that I can list /usr/local/lib/pam_pwdfile.so

    Any idea?

    Thanks

    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 pam_userdb.so 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
    Hublot

    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:

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

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

    Hi….,
    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:

    Hey,
    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:

    Hey,
    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 :
    user_config_dir
    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:

    wonderful.!

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

    Hello,
    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
  43. wssustain749761 wrote:

    Wallace versucht mehr über Esther zu erfahren, findet aber in ihrer Wohnung nur die total verängstigte Mitbewohnerin der Gesuchten vor,IBP cable die von Wallace kaum zu beruhigen ist. Dalia kann ihm, als sie sich etwas beruhigt hat, auch kaum mehr über Esther erzählen, außer daß Esther schon seit längerem von jemanden verfolgt worden ist.

    Posted 04 May 2016 at 3:40 pm
  44. afloat711lmarlene wrote:

    Noch zu berichten sei, daß dieser Teil diesmal nicht von Steven Spielberg persönlich angefertigt wurde, sondern daß er dem Special Effects-Kenner Joe Johnston dies überließ.Ultrasound Probe
    Johnston arbeitete lange Jahre, unter anderem auch für Spielberg und George Lucas, als Art Director, wobei er das Aussehen vieler Dinge bei der Star Wars Trilogie gestalten durfte, z. B. den Originalentwurf des kleinen Jedimeister Joda.more:http://www.ultrasoundprobes2016.com/products/

    Posted 14 May 2016 at 3:12 pm
  45. giengspe wrote:

    Send a press release to Hot Product News.13Computer Hardware - Compare Prices and Sellers Ratings
    Click Here to COMPARE TOTAL PRICES including tax and shipping costs.ultrasound machines Read product reviews and shop trusted sellers at Calibex.com.14Computer Hardware Products - Lowest Prices At DealTime!

    Posted 16 May 2016 at 5:03 pm
  46. gogsqbxr wrote:

    Aubrey was left in Powell’s care by her mother, ESAOTE CA421 Jasmine Littlejohn, who was facing jail time on drug charges.

    Posted 17 May 2016 at 10:02 am
  47. enzymejBarbara9162 wrote:

    The Ugly Feet Handbook grant you everything you need to create your own dream life. If you want full satisfaction, you need high quality The Ugly Feet HandbookThis is very easy to use even for a beginner, who lack the skill of an experienced user. PHILIPS C5-2 It helps you to create outstanding professional result, and thereby you can impress your colleagues.

    Posted 17 May 2016 at 2:02 pm
  48. Mallorytwfactor682 wrote:

    The item is designed in such a way as to make sure that a budget-conscious consumer is not forced to GE 3S-RS http://www.probesalokamachines.com/GE-3S-RS.html compromise on quality.Run Your Own Search Engine And Make Money Like Google! is totally worth purchasing and is fully tested by our group of product experts.

    Posted 19 May 2016 at 4:28 pm
  49. Oakley Ten with clea wrote:

    In 1910 the proceeds of the Surrey v. Oakley Ten with clear frame fire iridium lens http://www.icoolglassessale.com/oakley-p-414.html Kent match at the Oval were given to him as a benefit, with the result that he cleared upwards of 1,400.

    Posted 24 May 2016 at 4:48 pm
  50. Aloka UST-5524 wrote:

    The FCC can thus guarantee 30% of the country will have the net neutrality that they are not allowed to impose via a rulemaking. Aloka UST-5524 http://www.toshibaprobemachines.com/Aloka-UST-5524.html This opportunity may be the strongest reason the FCC has for supporting the merger.

    Posted 01 Jun 2016 at 3:45 pm
  51. HONDA Probe wrote:

    PG: I know. I read the last issue on the plane over here and had similar thoughts. For us though, going green is not an extreme or fanatic thing. HONDA Probe http://www.toshibaprobemachines.com/HONDA-Probe We take a pretty moderate approach to it. You’re going to use your computer, your cell phone, you’re going to need to fly now and then. You have to look to other aspects of your life to offset those necessary things.

    Posted 03 Jun 2016 at 1:51 pm
  52. philipsprobemachines wrote:

    I think the theatrical cut is just better than “The Version You’ve Never Seen,” except for the stairs scene. First of all, when Chris MacNeil is crying into the wall about Burke’s death, there’s a moment that’s cut from the theatrical release where she turns to Sharon, and you know she’s about to say, basically, “Reagan killed Burke.” Which is really important, that she knows even then how shit went down.philipsprobemachines But the real humdinger is what happens next I know the SFX are kinda cheesy on the stairs, but Ellen Burstyn’s face when she sees what’s happening is one of the best reaction shots in the whole movie, and it’s a shame it had to be cut from the theatrical release..

    The problem is that non S VHS VCRs do not record or playback S Video signals, they only work with Composite video. Some special VCRs may convert the Composite video to S Video for convenience, but you will not really see any improvement in quality because the video is still recorded on the tape(and broadcast over the air as analog television) in Composite form, so your resulting image will never be any better than it’s Composite origin(with some special exceptions that wouldn’t apply to you). Having seen your problem many times before, I am going to assume that you are using a SCART adapter on your VCR that has an S Video connector on it.

    Posted 08 Jun 2016 at 10:06 am
  53. payday loans no cred wrote:

    The second section of the form gives details of the commissioner of the survey and the actual person who carried out the survey along with his or her license number to operate as a pest control inspector.payday loans no credit check http://www.paydayloansonline.cn The next part deals with any problems found and how to remedy them.

    There should be no portion or even space or field left empty on the The NPMA 33 Termite Inspection Form. When it has been finished, copies should be sent to interested parties and agreements about corrective work made. It is a question of mutual agreement whether the corrective work is carried out by the vendor or the buyer. If you are interested in this or if you are wondering: What Does A Termite Look Like?. Please go to our web site now for further details.

    Posted 12 Jun 2016 at 1:53 pm
  54. Oakleys Radar Pitch wrote:

    The study of protease biology is challenging at many levels: their regulation is complex occurring during gene transcription, cell trafficking,Oakleys Radar Pitch with neon pink frame fire iridium lens,http://www.buyniceglasses.com/oakley-p-201.html extracellular secretion, activation of latent forms and recycling; their substrate specificity and preference can vary from in vitro to in vivo and diseased to non diseased tissues and finally there is a high degree of redundancy amongst different proteases, which can lead to complex compensatory mechanisms.

    Posted 12 Jun 2016 at 2:46 pm
  55. Oakley Pit Boss dark wrote:

    Natascha Werke Nata sanjarije natje Nawiedzona Ula la Nel baule di Marci Nel calderone, di tutto un po Nelasbasteleien neline magnolia blog Nellie Scrapkaartjes NENA nessys (crafting ) notes Nettes Stampworld Netty Oakley Pit Boss dark brown frame VR28 iridium lens http://www.icoolglassessale.com/oakley-p-381.html Cards Netty Craftings Neva Crafty Cave Never Enough Stamps NGCARDS nicky stamps scraps / nicky barnetts crochet works Nicola Creations Nicole Butterfly Ears Nicole stamp addiction Nicoline Cardcreations Nico Kreativwelt Nina Porokh Nina Schatzkiste Ninas dr Oakley Pit Boss with polished orange frame fire iridium lens http://www.icoolglassessale.com/oakley-p-386.html ninchenschaos Nixe Moni Noami Noa Bastelwelt Notes By Nina Noworoczna wymiana album Nubes de Azucar Nutty Nanas Blog O Recado Est Dado Ocean of imaginations oefenblog van Margreet Oh My Crafts Blog Oh Well .

    Posted 12 Jun 2016 at 3:15 pm
  56. payday loans no cred wrote:

    After cutting out the knife blank, use a bench grinder or belt sander to remove the burrs left by the cutting process. You will be left with a completely shiny surface that’s suddenly starting to look like a homemade knife.

    Drill three holes in the handle area of the knife blank to accept the rivets that will hold the wooden handles pieces. Anneal (soften) the steel first at these points with a small propane torch.

    Now it’s time to attach those wooden slabs. This is best done with epoxy glue and rivets.

    Rivets are available from knife making supply stores, but I just like to make mine from copper or brass round stock.payday loans no credit check It just seems more authentic on a homemade knife.

    Patience is the key when finishing up the homemade knife. The last step is the sharpening process, which is the skill that takes a little time to develop. If you take your time and tackle this slowly, you will do just fine.

    Slow even passes on the machine are what makes for perfect edges. Use very little pressure and try to keep a steady angle all the way across. payday loans no credit check http://www.paydayloansonline.cn If you feel the metal getting too hot, douse it in water to cool it.

    Sharpening is an art form and requires practice. If you’re patient and careful you will learn this step quickly. You will then be able to create a homemade knife in no time and have a kitchen tool that will likely out live you.

    Posted 17 Jun 2016 at 1:50 pm
  57. niccolpi wrote:

    This is a very simplistic representation of Nonaka
    and Takeuchi’s model, however even this can
    encourage us to look at traditional human resources
    activities with a new perspective. guaranteed payday loans http://www.mwtank.com/ For example, when
    we are hiring do we attach sufficient value to creativity
    at all levels of the organisation? Do we design jobs
    so that people can interact in ways that stimulate
    development of new ideas?guaranteed payday loans Do we appraise and reward
    people for continuous learning and sharing of ideas?
    Are our training and development programmes focussed
    on doing the job or on maximising potential for knowledge
    creation? When people are leaving the organisation
    do we allow valuable organisational knowledge walk
    out the door without making an effort to document
    or share it in some way?

    Posted 21 Jun 2016 at 3:44 pm
  58. distincsd wrote:

    Cosmetic surgery is something that tends to take many years off one”s skin in a matter of a short time While there are other treatments available for a younger looking skin, the fact remains that cosmetic surgery has faster results that are also more long lasting
    Cosmetic surgery is something that tends to take many years off one”s skin in a matter of a short time.philipsprobemachines.com While there are other treatments available for a younger looking skin, the fact remains that cosmetic surgery has faster results that are also more long lasting. When we consider cosmetic surgery, it seems not only dramatic, but is also costly, all the while being something that has its own risks and consequences.

    Many people get cosmetic surgery because they are not satisfied with their appearance and want to boost their self-esteem by getting a better body shape and improved physical appearance. And while wanting to do all this, people usually ignore the possible risks that are associated with the procedure and also the consequences.

    One important fact is that cosmetic surgery does not offer perfection, just improvement. So it is good to be clear about that limitation. The procedure is lengthy and the recovery also takes time. And in spite of cost involved, you are still exposed to potential risks. The risk that has to be most obvious one is that the result might not be what you expect and your health is also at risk.

    Posted 24 Jun 2016 at 4:22 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 *

Close
E-mail It