{"id":653,"date":"2005-01-25T10:49:47","date_gmt":"2005-01-25T14:49:47","guid":{"rendered":"http:\/\/wordpress.cephas.net\/?p=653"},"modified":"2005-01-25T10:49:47","modified_gmt":"2005-01-25T14:49:47","slug":"proftpd-and-jailing-users","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2005\/01\/25\/proftpd-and-jailing-users\/","title":{"rendered":"ProFTPD and jailing users"},"content":{"rendered":"<p>I moved all my sites to <a href=\"http:\/\/vpscenter.com\/\">vpscenter.com<\/a> a couple months back on <a href=\"http:\/\/www.joecheng.com\/blog\/entries\/VirtualPrivateServersrock.html\">Joe&#8217;s recommendation<\/a> and I&#8217;m hosting sites for a couple buddies on it right now. One of the problems with opening your server up to your buddies is that, trustworthy as they may be, you don&#8217;t want them mucking around with the system by CD&#8217;ing up to places they shouldn&#8217;t be hanging out. The guys at VPS Center have provided a nice web-based app for the creation of FTP users, but you can&#8217;t lock down the users to a specific directory via the web. I did some research today and found out that you can edit the <a href=\"http:\/\/www.proftpd.org\/\">ProFTPD<\/a> configuration file so that users are &#8220;jailed&#8221; (a ProFTPD term, not mine) into their websites and can&#8217;t muck around outside their own sandbox. <\/p>\n<p>The configuration file lives on my system at \/etc\/proftpd.conf, open that puppy up and add:<br \/>\n<code><br \/>\n<a href=\"http:\/\/www.proftpd.org\/docs\/directives\/linked\/config_ref_DefaultRoot.html\">DefaultRoot<\/a> \/usr\/hosts\/yoursite.com groupname<br \/>\n<\/code><br \/>\nwhere <code>\/usr\/hosts\/yoursite.com<\/code> is the directory containing the site that you want to lock down and <code>groupname<\/code> is the name of the group (usually the same as the username) that you want to restrict. Restart the server (<code>\/etc\/rc.d\/init.d\/proftpd restart<\/code>) and the next time the user in question logs in, they&#8217;ll be automatically redirected to the &#8216;jailed&#8217; directory and they won&#8217;t be be able to browse directories above the one you&#8217;ve established as the base.<\/p>\n<p>On a related note, if it seems like your FTP connections take forever to establish, add:<br \/>\n<code><br \/>\n<a href=\"http:\/\/www.proftpd.org\/docs\/directives\/linked\/config_ref_UseReverseDNS.html\">UseReverseDNS<\/a> off<br \/>\n<a href=\"http:\/\/www.proftpd.org\/docs\/directives\/linked\/config_ref_IdentLookups.html\">IdentLookups<\/a> off<br \/>\n<\/code><br \/>\nto the ProFTPD configuration file as well (restart required).  You&#8217;ll see a dramatic decrease in the amount of time it takes to make an FTP connection.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I moved all my sites to vpscenter.com a couple months back on Joe&#8217;s recommendation and I&#8217;m hosting sites for a couple buddies on it right now. One of the problems with opening your server up to your buddies is that, trustworthy as they may be, you don&#8217;t want them mucking around with the system by &hellip; <a href=\"https:\/\/cephas.net\/blog\/2005\/01\/25\/proftpd-and-jailing-users\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ProFTPD and jailing users<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/653"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=653"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/653\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}