{"id":1651,"date":"2011-10-11T12:08:13","date_gmt":"2011-10-11T17:08:13","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=1651"},"modified":"2012-08-14T18:07:23","modified_gmt":"2012-08-14T23:07:23","slug":"set-up-pure-ftpd-server-with-virtual-user-on-freebs","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/set-up-pure-ftpd-server-with-virtual-user-on-freebs\/","title":{"rendered":"How to Set up a Pure-FTPd Server with Virtual User on FreeBSD"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1645\" data-permalink=\"https:\/\/icesquare.com\/wordpress\/set-up-pure-ftpd-server-with-virtual-user-on-fedora-linux\/pure-ftpd\/#main\" data-orig-file=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/10\/pure-ftpd.png\" data-orig-size=\"224,64\" data-comments-opened=\"1\" data-image-title=\"Pure-FTPd\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/10\/pure-ftpd.png\" src=\"\/wordpress\/wp-content\/uploads\/2011\/10\/pure-ftpd.png\" alt=\"\" title=\"Pure-FTPd\" width=\"224\" height=\"64\" class=\"alignleft size-full wp-image-1645\" \/><\/p>\n<p>This tutorial is for FreeBSD. If you are looking for setting up Pure-FTPd on Linux, click <a href=\"\/wordpress\/set-up-pure-ftpd-server-with-virtual-user-on-fedora-linux\/\" target=\"_blank\">here<\/a>.<\/p>\n<p>My client likes to send me a huge data file (More than 10GB after compressed). Since I don&#8217;t care about the security during the transfer, I decide to go with the old school technology: FTP.<\/p>\n<p>Basically, I need to set up a FTP server with virtual user. In the other words, the log in used by the FTP server has nothing to do with my system login, and I can easily disable that at any time.<\/p>\n<p>1.) Install Pure-FTPd<\/p>\n<pre>\r\nsudo pkg_add -r pure-ftpd\r\n<\/pre>\n<p>2.) Create a user for Pure-FTPd, here I simply call it <strong>ftpuser<\/strong>.<\/p>\n<pre>\r\nsudo adduser ftpuser\r\n<\/pre>\n<p>3.) Let say, we want to create a user called guest to access the ftp server. guest is a virtual user, and its virtual home is in \/home\/ftpuser\/guest<\/p>\n<pre>\r\nsudo mkdir \/home\/ftpuser\/guest\r\nsudo chown -R ftpuser:ftpuser  \/home\/ftpuser\/\r\nsudo chmod a+rw -R \/home\/ftpuser\/\r\n<\/pre>\n<p>4.) Edit \/etc\/inetd.conf and add the following:<\/p>\n<pre>\r\nftp     stream  tcp     nowait  root    \/usr\/local\/sbin\/pure-ftpd -O stats:\/var\/log\/pureftpd.log       pure-ftpd -l puredb:\/usr\/local\/etc\/pureftpd.pdb\r\n<\/pre>\n<p>5.) Restart inetd <\/p>\n<pre>\r\nps -ax | grep inetd\r\nsudo killall -HUP inetd\r\nsudo \/usr\/sbin\/inetd -wW -C 6\r\n<\/pre>\n<p>6.) Edit \/etc\/syslog.conf <\/p>\n<pre>\r\nsudo nano \/etc\/syslog.conf\r\n<\/pre>\n<p>7.) Restart syslog<\/p>\n<pre>\r\nps -ax | grep syslog\r\nkillall -HUP syslogd\r\n\/usr\/sbin\/syslogd -ss\r\n<\/pre>\n<p>8.) Create a user and add it into the Pure-FTPd database:<\/p>\n<pre>\r\nsudo pure-pw useradd guest -u ftpuser -d \/home\/ftpuser\/guest\/\r\n<\/pre>\n<p>You can also set the quota and maximum space:<br \/>\n1000 files, 100MB quota<\/p>\n<pre>\r\npure-pw useradd guest -u ftpuser -d \/home\/ftpuser\/guest\/ -n 1000 -N 100 \r\n<\/pre>\n<p>9.) Set the password in case you forget the enter the password:<\/p>\n<pre>\r\npure-pw passwd guest\r\n<\/pre>\n<p>10.) Update the database:<\/p>\n<pre>\r\npure-pw mkdb\r\n<\/pre>\n<p>11.) If the system could not update the database, try this instead (One command, not two):<\/p>\n<pre>\r\nsudo pure-pw mkdb \/usr\/local\/etc\/pureftpd.pdb -f \/usr\/local\/etc\/pureftpd.passwd\r\n<\/pre>\n<p>That&#8217;s it!<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial is for FreeBSD. If you are looking for setting up Pure-FTPd on Linux, click here. My client likes to send me a huge data file (More than 10GB <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/set-up-pure-ftpd-server-with-virtual-user-on-freebs\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[94,7,144,6,69],"tags":[171,97,128],"class_list":["post-1651","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-freebsd","category-sever-problem","category-technology","category-troubleshooting-technology","tag-freebsd","tag-ftp","tag-pure-ftpd"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-qD","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1643,"url":"https:\/\/icesquare.com\/wordpress\/set-up-pure-ftpd-server-with-virtual-user-on-fedora-linux\/","url_meta":{"origin":1651,"position":0},"title":"How to Set up a Pure-FTPd Server with Virtual User on Fedora","author":"Derrick","date":"October 11, 2011","format":false,"excerpt":"This tutorial is for Fedora Linux. If you are looking for setting up Pure-FTPd on FreeBSD, click here. My client likes to send me a huge data file (More than 10GB after compressed). Since I don't care about the security during the transfer, I decide to go with the old\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"\/wordpress\/wp-content\/uploads\/2011\/10\/pure-ftpd.png","width":350,"height":200},"classes":[]},{"id":730,"url":"https:\/\/icesquare.com\/wordpress\/fetch-ftpftp-freebsd-orgpubfreebsdportsdistfilesngx-fancyindex-0-2-2-tar-bz2-file-unavailable-e-g-file-not-found-no-access\/","url_meta":{"origin":1651,"position":1},"title":"fetch: ftp:\/\/ftp.FreeBSD.org\/pub\/FreeBSD\/ports\/distfiles\/ngx-fancyindex-0.2.2.tar.bz2: File unavailable (e.g., file not found, no access)","author":"Derrick","date":"June 9, 2010","format":false,"excerpt":"Today I tried to run the upgrade my nginx on my FreeBSD box, and I received the following message: ===> Vulnerability check disabled, database not found ===> License accepted by the user ===> Found saved configuration for nginx-0.7.66 => ngx-fancyindex-0.2.2.tar.bz2 doesn't seem to exist in \/usr\/ports\/distfiles\/. => Attempting to fetch\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3295,"url":"https:\/\/icesquare.com\/wordpress\/freebsdproblem-to-update-curl-7-31-0\/","url_meta":{"origin":1651,"position":2},"title":"[FreeBSD]Problem to Update cURL-7.31.0","author":"Derrick","date":"August 6, 2013","format":false,"excerpt":"When I tried to update the cURL to cURL 7.31.0 today for my FreeBSD, it stopped and gave the following error messages: configure: using CFLAGS: -O2 -pipe -DLDAP_DEPRECATED -fno-strict-aliasing configure: CFLAGS error: CFLAGS may only be used to specify C compiler flags, not macro definitions. Use CPPFLAGS for: -DLDAP_DEPRECATED configure:\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":505,"url":"https:\/\/icesquare.com\/wordpress\/solvedfedora-repository-error-errno-14-pycurl-error-6\/","url_meta":{"origin":1651,"position":3},"title":"[Solved]Fedora Linux Repository Error ([Errno 14] PYCURL ERROR 6)","author":"Derrick","date":"January 4, 2010","format":false,"excerpt":"I was having trouble to update my Fedora Linux system by running sudo yum update. sudo yum update Loaded plugins: presto, refresh-packagekit Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again sometimes I see different sets of error: http:\/\/download.fedoraproject.org\/pu...ta\/repomd.xml: [Errno 14] PYCURL ERROR\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"Fedoraproject.org has downed.","src":"\/wordpress\/wp-content\/uploads\/2010\/01\/Fedora-Down-300x217.png","width":350,"height":200},"classes":[]},{"id":31,"url":"https:\/\/icesquare.com\/wordpress\/installing-apache-php-mysql-and-memcached-on-freebsd\/","url_meta":{"origin":1651,"position":4},"title":"Installing Apache, PHP, MySQL and MemCached on FreeBSD","author":"Derrick","date":"May 19, 2009","format":false,"excerpt":"This is my note on how to to install Apache, PHP, MySQL and MemCached on a FreeBSD 7 Box. 1. MySQL Go to the mysql52-server port directory by typing the command: cd \/usr\/ports\/databases\/mysql51-server Build the port by typing: make BUILD_OPTIMIZED=yes BUILD_STATIC=yes Using these two options will speed up the execution\u2026","rel":"","context":"In &quot;FreeBSD&quot;","block_context":{"text":"FreeBSD","link":"https:\/\/icesquare.com\/wordpress\/category\/sever-problem\/freebsd\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3309,"url":"https:\/\/icesquare.com\/wordpress\/sftp-without-ssh-shell-access-2\/","url_meta":{"origin":1651,"position":5},"title":"SFTP Without SSH Shell Access","author":"Derrick","date":"October 7, 2013","format":false,"excerpt":"I got an interesting question today. Our client needs to access to the server via SFTP, but they want to disable to the access to the SSH shell. Assuming that you are fully aware of the potential issues of doing it, such ask security risk etc, here is how to\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1651"}],"version-history":[{"count":6,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1651\/revisions"}],"predecessor-version":[{"id":2863,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1651\/revisions\/2863"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}