{"id":873,"date":"2013-04-30T21:32:43","date_gmt":"2013-04-30T21:32:43","guid":{"rendered":"http:\/\/www.omniweb.com\/wordpress\/?p=873"},"modified":"2013-04-30T21:39:29","modified_gmt":"2013-04-30T21:39:29","slug":"lock-down-vsftp-and-give-access-to-symlinks","status":"publish","type":"post","link":"https:\/\/www.omniweb.com\/wordpress\/?p=873","title":{"rendered":"Lock down vsftpd and give access to symlinks"},"content":{"rendered":"<p>Locking down vsftp <a href=\"http:\/\/www.cyberciti.biz\/tips\/vsftp-chroot-users-limit-to-only-their-home-directory.html\">is pretty easy<\/a>, but giving access to symlinks is another issue entirely.<\/p>\n<p>To lock down vsftp, use the method as per the link above (chroot_local_user=YES) or one may also use the feature in vsFTP that allows a list of users who should \/ shouldn&#8217;t be chrooted;<\/p>\n<p><code># You may specify an explicit list of local users to chroot() to their home<br \/>\n# directory. If chroot_local_user is YES, then this list becomes a list of<br \/>\n# users to NOT chroot().<br \/>\nchroot_list_enable=YES<br \/>\n# (default follows)<br \/>\nchroot_list_file=\/etc\/vsftpd\/chroot_list<br \/>\n<\/code><\/p>\n<p>Then give a restart with <code>\/etc\/init.d\/vsftpd restart<\/code><\/p>\n<p>But there&#8217;s a problem if the user needs to access a folder outside the chroot that&#8217;s symlinked into his folder.  With vsFTP, the folder can&#8217;t be seen!  Luckily, <a href=\"http:\/\/radu.cotescu.com\/vsftpd-and-symbolic-links\/\">Radu has the solution<\/a> for us to resolve the symlink problem.<\/p>\n<p>We create a new folder, then use mount to make an existing otherwise-inaccessible folder available via chrooted vsftp:<br \/>\n<code><br \/>\nmkdir \/home\/me\/webfolder<br \/>\nmount --bind \/var\/www\/webfolder \/home\/me\/webfolder<br \/>\n<\/code><\/p>\n<p>that&#8217;s it, given that the permissions are OK, now the user can do what they need to!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Locking down vsftp is pretty easy, but giving access to symlinks is another issue entirely. To lock down vsftp, use the method as per the link above (chroot_local_user=YES) or one may also use the feature in vsFTP that allows a &hellip; <a href=\"https:\/\/www.omniweb.com\/wordpress\/?p=873\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/873"}],"collection":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=873"}],"version-history":[{"count":7,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/873\/revisions"}],"predecessor-version":[{"id":880,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/873\/revisions\/880"}],"wp:attachment":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}