{"id":19221,"date":"2016-07-12T06:03:06","date_gmt":"2016-07-11T22:03:06","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2016\/07\/12\/%e5%9c%a8-freebsd-%e4%b8%8a%e5%ae%89%e8%a3%9d-proftpd-server\/"},"modified":"2016-07-12T06:03:06","modified_gmt":"2016-07-11T22:03:06","slug":"%e5%9c%a8-freebsd-%e4%b8%8a%e5%ae%89%e8%a3%9d-proftpd-server","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2016\/07\/12\/%e5%9c%a8-freebsd-%e4%b8%8a%e5%ae%89%e8%a3%9d-proftpd-server\/","title":{"rendered":"\u5728 FreeBSD \u4e0a\u5b89\u88dd ProFTPD Server"},"content":{"rendered":"<p>\u5728 FreeBSD \u4e0a\u5b89\u88dd\u548c FreeNAS \u53ca NAS4Free \u76f8\u540c\u7684 FTP Server\u3002<br \/>1. \u5b89\u88dd ProFTPD Server<br \/># <span style=\"color: #ff0000;\">pkg install proftpd<\/span><\/p>\n<p>2. \u8a2d\u5b9a\u6a94\u4f4d\u7f6e <span style=\"color: #0000ff;\">\/usr\/local\/etc\/proftpd.conf<\/span><br \/># <span style=\"color: #ff0000;\">grep -v -E &#8216;^#|^$&#8217; \/usr\/local\/etc\/proftpd.conf<\/span><br \/><span style=\"color: #0000ff;\">ServerName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;ProFTPD Default Installation&#8221;<\/span><br \/><span style=\"color: #0000ff;\">ServerType\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 standalone<\/span><br \/><span style=\"color: #0000ff;\">DefaultServer\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on<\/span><br \/><span style=\"color: #0000ff;\">ScoreboardFile\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/var\/run\/proftpd\/proftpd.scoreboard<\/span><br \/><span style=\"color: #0000ff;\">Port\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 21<\/span><br \/><span style=\"color: #0000ff;\">UseIPv6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on<\/span><br \/><span style=\"color: #0000ff;\">Umask\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 022<\/span><br \/><span style=\"color: #0000ff;\">MaxInstances\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 30<\/span><br \/><span style=\"color: #0000ff;\">CommandBufferSize\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 512<\/span><br \/><span style=\"color: #0000ff;\">User\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 nobody<\/span><br \/><span style=\"color: #0000ff;\">Group\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 nogroup<\/span><br \/><span style=\"color: #0000ff;\">DefaultRoot ~ !<\/span><br \/><span style=\"color: #0000ff;\">AllowOverwrite\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on<\/span><br \/><span style=\"color: #0000ff;\">&lt;Limit SITE_CHMOD&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 DenyAll<\/span><br \/><span style=\"color: #0000ff;\">&lt;\/Limit&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 ### We want clients to be able to login with &#8220;anonymous&#8221; as well as &#8220;ftp&#8221;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 # UserAlias\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 anonymous ftp<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 ### Limit the maximum number of anonymous logins<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 # MaxClients\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 ### We want &#8216;welcome.msg&#8217; displayed at login, and &#8216;.message&#8217; displayed<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 ### in each newly chdired directory.<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 # DisplayLogin\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 welcome.msg<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 # DisplayFirstChdir\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 .message<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 ### Limit WRITE everywhere in the anonymous chroot<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 # &lt;Limit WRITE&gt;<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 #\u00a0\u00a0 DenyAll<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 # &lt;\/Limit&gt;<\/span>[@more@]3. \u4fee\u6539 <span style=\"color: #0000ff;\">\/etc\/rc.conf<\/span>\uff0c\u8a2d\u5b9a\u958b\u6a5f\u6642\u555f\u52d5<br \/># <span style=\"color: #ff0000;\">vim \/etc\/rc.conf<\/span><br \/>\u52a0\u5165\u4e0b\u9762\u4e00\u884c<br \/><span style=\"color: #0000ff;\">proftpd_enable=&#8221;YES&#8221;<\/span><br \/>\u6216<br \/># <span style=\"color: #ff0000;\">echo &#8216;<\/span><span style=\"color: #ff0000;\">proftpd_enable=&#8221;YES&#8221;&#8216; &gt;&gt; \/etc\/rc.conf<\/span><\/p>\n<p>4. \u555f\u52d5 ProFTPD Server<br \/># <span style=\"color: #ff0000;\">\/usr\/local\/sbin\/proftpd &amp;<\/span><\/p>\n<p>5. \u6aa2\u67e5 FTP Server \u662f\u5426\u6709\u6b63\u5e38\u555f\u52d5<br \/># <span style=\"color: #ff0000;\">netstat -an | grep *.21<\/span><br \/><span style=\"color: #0000ff;\">tcp46\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0\u00a0 0 *.21\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 *.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 LISTEN<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 FreeBSD \u4e0a\u5b89\u88dd\u548c FreeNAS \u53ca NAS4Free \u76f8\u540c\u7684 FTP Server\u30021. \u5b89\u88dd &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2016\/07\/12\/%e5%9c%a8-freebsd-%e4%b8%8a%e5%ae%89%e8%a3%9d-proftpd-server\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u5728 FreeBSD \u4e0a\u5b89\u88dd ProFTPD Server\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105,130],"tags":[],"class_list":["post-19221","post","type-post","status-publish","format-standard","hentry","category-c-98634","category-c-78475"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["648464"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19221"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=19221"}],"version-history":[{"count":0,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19221\/revisions"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=19221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=19221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=19221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}