{"id":1004,"date":"2015-10-31T13:25:36","date_gmt":"2015-10-31T13:25:36","guid":{"rendered":"http:\/\/poojanwagh.opalstacked.com\/techblog\/?p=1004"},"modified":"2015-10-31T13:25:36","modified_gmt":"2015-10-31T13:25:36","slug":"setting-up-an-ftp-only-user-on-freebsd","status":"publish","type":"post","link":"https:\/\/tech.poojanblog.com\/blog\/unix-linux\/setting-up-an-ftp-only-user-on-freebsd\/","title":{"rendered":"Setting up an FTP-only user on FreeBSD"},"content":{"rendered":"<p>I recently bought an IP camera. (To be honest, I went on a bit of a shopping spree for IP cameras.)<\/p>\n<p>These cameras support FTP as a storage mechanism for video and snapshots (motion-detecting for example).<\/p>\n<p>As a result, I wanted to set up an FTP user on my FreeBSD machine.<\/p>\n<p>Iniitally, I tried creating a user with a shell of \/usr\/sbin\/nologin, but that doesn&#8217;t work for FTP. FTP users need to have a shell in \/etc\/shells.<\/p>\n<p>I saw <a href=\"http:\/\/lists.freebsd.org\/pipermail\/freebsd-questions\/2005-December\/108639.html\" target=\"_blank\">this post<\/a> which talks about FTP requiring a shell in \/etc\/shells, and that adding \/sbin\/nologin is a bad idea. Instead, it recommends making a copy in \/usr\/local\/bin\/ and adding that copy to \/etc\/shells.<\/p>\n<p>Instead, I made a link\u2014in case (for some reason) there&#8217;s an update to \/sbin\/nologin, I want the FTP user to get an update.<\/p>\n<p><code>ln -s \/sbin\/nologin \/usr\/local\/bin\/nologin-ftp-only<\/code><\/p>\n<p>I then added <code>\/usr\/local\/bin\/nologin-ftp-only<\/code> to <code>\/etc\/shells<\/code>.<\/p>\n<p>To be even more secure, I made the <a href=\"http:\/\/lists.freebsd.org\/pipermail\/freebsd-questions\/2003-June\/010237.html\" target=\"_blank\">FTP user&#8217;s account chrooted<\/a> by creating <code>\/etc\/ftpchroot<\/code>.<\/p>\n<div class='wp_likes' id='wp_likes_post-1004'><a class='like' href=\"javascript:wp_likes.like(1004);\" title='' ><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/tech.poojanblog.com\/blog\/wp-content\/plugins\/wp-likes\/images\/like.png\" alt='' border='0'\/><\/a><span class='text'>Be the first to like.<\/span><\/p>\n<div class='like' ><a href=\"javascript:wp_likes.like(1004);\">Like<\/a><\/div>\n<div class='unlike' ><a href=\"javascript:wp_likes.unlike(1004);\">Unlike<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I recently bought an IP camera. (To be honest, I went on a bit of a shopping spree for IP cameras.) These cameras support FTP as a storage mechanism for video and snapshots (motion-detecting for example). As a result, I wanted to set up an FTP user on my FreeBSD machine. Iniitally, I tried creating [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-1004","post","type-post","status-publish","format-standard","hentry","category-unix-linux"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/posts\/1004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/comments?post=1004"}],"version-history":[{"count":2,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/posts\/1004\/revisions"}],"predecessor-version":[{"id":1007,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/posts\/1004\/revisions\/1007"}],"wp:attachment":[{"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/media?parent=1004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/categories?post=1004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/tags?post=1004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}