{"id":2583,"date":"2016-03-19T09:53:29","date_gmt":"2016-03-19T09:53:29","guid":{"rendered":"http:\/\/truelogic.org\/wordpress\/?p=2583"},"modified":"2016-03-19T09:53:29","modified_gmt":"2016-03-19T09:53:29","slug":"setup-proftp-in-freebsd","status":"publish","type":"post","link":"https:\/\/truelogic.org\/wordpress\/2016\/03\/19\/setup-proftp-in-freebsd\/","title":{"rendered":"Setup ProFTP in FreeBSD"},"content":{"rendered":"<p>Instructions for setting up an internal FTP server on a FreeBSD 10 machine. Note that this machine is not setup for public access and hence no specific security steps have been taken.<\/p>\n<p>&nbsp;<\/p>\n<h3>Installing<\/h3>\n<p><em>portmaster ftp\/profptd<\/em><\/p>\n<p>&nbsp;<\/p>\n<h3>Configuration<\/h3>\n<p>We will set up a user called ftpuser with a password to be used for ftp login.<\/p>\n<p>The configuration file for proftp will be in \/usr\/local\/etc\/proftpd.conf<\/p>\n<p>We will use the default settings.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<pre>#\r\n# For more information about Proftpd configuration\r\n# see http:\/\/www.proftpd.org\/\r\n#\r\n# This is a basic ProFTPD configuration file (rename it to \r\n# 'proftpd.conf' for actual use.  It establishes a single server\r\n# and a single anonymous login.  It assumes that you have a user\/group\r\n# \"nobody\" and \"ftp\" for normal operation and anon.\r\n\r\nServerName\t\t\t\"ProFTPD Default Installation\"\r\nServerType\t\t\tstandalone\r\nDefaultServer\t\t\ton\r\nScoreboardFile\t\t\/var\/run\/proftpd\/proftpd.scoreboard\r\n\r\n# Port 21 is the standard FTP port.\r\nPort\t\t\t\t21\r\n\r\n# Use IPv6 support by default.\r\nUseIPv6\t\t\t\ton\r\n\r\n# Umask 022 is a good standard umask to prevent new dirs and files\r\n# from being group and world writable.\r\nUmask\t\t\t\t022\r\n\r\n# To prevent DoS attacks, set the maximum number of child processes\r\n# to 30.  If you need to allow more than 30 concurrent connections\r\n# at once, simply increase this value.  Note that this ONLY works\r\n# in standalone mode, in inetd mode you should use an inetd server\r\n# that allows you to limit maximum number of processes per service\r\n# (such as xinetd).\r\nMaxInstances\t\t\t30\r\n\r\nCommandBufferSize\t512\r\n\r\n# Set the user and group under which the server will run.\r\nUser\t\t\t\tnobody\r\nGroup\t\t\t\tnogroup\r\n\r\n# To cause every FTP user to be \"jailed\" (chrooted) into their home\r\n# directory, uncomment this line.\r\n#DefaultRoot ~\r\n\r\n# Normally, we want files to be overwriteable.\r\nAllowOverwrite\t\ton\r\n\r\n# Bar use of SITE CHMOD by default\r\n\r\n  DenyAll\r\n\r\n\r\n# A basic anonymous configuration, no upload directories.  If you do not\r\n# want anonymous users, simply delete this entire  section.\r\n\r\n#########################################################################\r\n#                                                                       #\r\n# Uncomment lines with only one # to allow basic anonymous access       #\r\n#                                                                       #\r\n#########################################################################\r\n\r\n#\r\n#   User\t\t\t\tftp\r\n#   Group\t\t\t\tftp\r\n\r\n  ### We want clients to be able to login with \"anonymous\" as well as \"ftp\"\r\n  # UserAlias\t\t\tanonymous ftp\r\n\r\n  ### Limit the maximum number of anonymous logins\r\n  # MaxClients\t\t\t10\r\n\r\n  ### We want 'welcome.msg' displayed at login, and '.message' displayed\r\n  ### in each newly chdired directory.\r\n  # DisplayLogin\t\t\twelcome.msg\r\n  # DisplayFirstChdir\t\t.message\r\n\r\n  ### Limit WRITE everywhere in the anonymous chroot\r\n  # \r\n  #   DenyAll\r\n  # \r\n#\r\n\r\n\r\n\r\n<\/pre>\n<h3>Testing<\/h3>\n<p>Run <em>service profptd start<\/em><\/p>\n<p>If it gives an error about hostname not found or hostname cannot be resolved then make sure you have entered the IP assignment for your local machine in \/etc\/hosts<\/p>\n<p>Eg. if your machine name is unixbox then in etc\/hosts you need to put<\/p>\n<p>127.0.0.1 unixbox<\/p>\n<p>If the service starts now then you should be able to test ftp login.<\/p>\n<p>&nbsp;<\/p>\n<p>To start the service on bootup, put<\/p>\n<p>proftpd_enable = &#8220;YES&#8221;<\/p>\n<p>in <em>\/etc\/rc.conf<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>Then copy profptd into \/etc\/rc.d<\/p>\n<p><em>cp \/usr\/local\/etc\/rc.d\/profptd\u00a0\u00a0\u00a0 \/etc\/rc.d<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Instructions for setting up an internal FTP server on a FreeBSD 10 machine. Note that this machine is not setup for public access and hence <a class=\"mh-excerpt-more\" href=\"https:\/\/truelogic.org\/wordpress\/2016\/03\/19\/setup-proftp-in-freebsd\/\" title=\"Setup ProFTP in FreeBSD\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":2586,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-2583","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-freebsd"],"_links":{"self":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/2583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/comments?post=2583"}],"version-history":[{"count":3,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/2583\/revisions"}],"predecessor-version":[{"id":2587,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/2583\/revisions\/2587"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media\/2586"}],"wp:attachment":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media?parent=2583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/categories?post=2583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/tags?post=2583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}