<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Ben Scobie</title><description>Latest posts from Ben Scobie</description><link>https://www.benscobie.com/</link><item><title>My Modded Lenovo T430</title><link>https://www.benscobie.com/posts/my-modded-lenovo-t430/</link><guid isPermaLink="true">https://www.benscobie.com/posts/my-modded-lenovo-t430/</guid><description>Reviving a Lenovo T430 with an IPS 1080p panel, i7 upgrade, more RAM, Wi-Fi 6 card, BIOS tweaks, fresh battery, and full cost breakdown.</description><pubDate>Thu, 15 Sep 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I’ve had a Lenovo T430 for many years and for most of those years it’s been sat gathering dust. Until I remember I have it, re-install some flavour of Linux on it and then promptly forget all about it again.&lt;/p&gt;
&lt;p&gt;Since working from home and recently moving house I’ve been less inclined to stay in my office after work to tinker with various projects, I just feel a bit yucky. Instead I’ve picked ol’ dusty back up again and have started using it on the sofa whilst watching TV. Only this time I’ve picked Fedora Workstation.&lt;/p&gt;
&lt;p&gt;What I like about the T430 is that it is built like a tank, the touchpad isn’t atrocious like some laptops and the keyboard is alright to type on as well. The only problem is, it’s just old. It has a pretty nasty 1366 x 768 TN panel which means any UI design work involving colours turns out awful and my particular model is an just an i5-3320M. I did throw an SSD in it some years ago which brought it back to a usable state though.&lt;/p&gt;
&lt;p&gt;Some people would just go out and buy a new laptop, and I thought about that as well. Something larger than a 14″ screen would have been nice. Instead I did some googling and came across several threads on Reddit talking about all the possible upgrades you can do with the T430. It turns out you can actually do quite a lot, and so there began my journey…&lt;/p&gt;
&lt;p&gt;Firstly, I want to shout out &lt;a href=&quot;https://medium.com/@n4ru/the-definitive-t430-modding-guide-3dff3f6a8e2e&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;this amazing article&lt;/a&gt; that really goes to town on what’s possible, you should definitely check it out. And without further ado, here’s the upgrades I carried out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Replaced the i5-3320M with an i7-3632QM from &lt;a href=&quot;https://ebay.us/VHbRUp&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;eBay&lt;/a&gt; (£77.99 + £7.50 for some &lt;a href=&quot;https://amzn.to/3RQUPBo&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;thermal compound&lt;/a&gt;). This stays with the 35W TDP. It does run a little hotter but not so much that I need to worry about extra cooling.&lt;/li&gt;
&lt;li&gt;Replaced the 2 x 4GB of RAM with 2 x 8GB of Crucial DDR3L 1866Mhz from &lt;a href=&quot;https://amzn.to/3Ubr2ol&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Amazon&lt;/a&gt; (£59.29)&lt;/li&gt;
&lt;li&gt;Modded the BIOS with &lt;a href=&quot;https://1vyra.in/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;1vyrain&lt;/a&gt; to unlock BIOS features like disabling Intel ME and removing the Wi-Fi whitelist&lt;/li&gt;
&lt;li&gt;Replaced the WiFI card with an Wi-Fi 6 AX3000H from &lt;a href=&quot;https://ebay.us/JMeo4t&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;eBay&lt;/a&gt;. This requires the BIOS mod above (£27.59)&lt;/li&gt;
&lt;li&gt;Replaced the 6-cell battery with a genuine OEM 9-cell battery from &lt;a href=&quot;https://ebay.us/GprA8B&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;eBay&lt;/a&gt;. My current one was very worn out. (£58.50)&lt;/li&gt;
&lt;li&gt;Replaced the TN panel with a Genuine Innolux N140HCE-EN1 Rev.C2 from &lt;a href=&quot;https://ebay.us/RZkGNt&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;eBay&lt;/a&gt;. It was supposed to have 2 dead pixels but I can’t see them at all, probably because the PPI is so high! (£79.99)&lt;/li&gt;
&lt;li&gt;LCD controller board kit to support that new panel. From &lt;a href=&quot;https://www.aliexpress.com/item/32836668337.html&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;AliExpress &lt;/a&gt;(£34.94)&lt;/li&gt;
&lt;li&gt;Genuine 90W charger from &lt;a href=&quot;https://ebay.us/16DD87&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;eBay&lt;/a&gt;. I found that my 65W charger wasn’t charging when the laptop was on, seems to be a common issue once upgrading the CPU. (£19.39)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So in total that cost £365.19, quite steep. I might’ve been able to pick up a 2nd hand laptop for that with similar/better specs, but boy did I have fun doing it.&lt;/p&gt;
&lt;p&gt;In terms of best bang for buck upgrade, I would definitely say that was the 1080p IPS panel. I’m amazed I put up with that awful TN panel for so long.&lt;/p&gt;</content:encoded></item><item><title>Traefik + Cloudflare: Keeping the origin server a secret</title><link>https://www.benscobie.com/posts/traefik-cloudflare-keeping-the-origin-server-a-secret/</link><guid isPermaLink="true">https://www.benscobie.com/posts/traefik-cloudflare-keeping-the-origin-server-a-secret/</guid><description>Hide your origin IP behind Cloudflare using Traefik with authenticated origin pulls, TLS hardening, and whitelist rules to stop direct hits.</description><pubDate>Sat, 27 Aug 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I recently started using Cloudflare proxying for all of the services I host under *.benscobie.com to reduce the attack surface on the origin server. In order for this to work effectively we need to ensure we aren’t leaking the origin server’s IP address in any way. This post details the steps I took to mitigate this when using &lt;a href=&quot;https://traefik.io/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;traefik&lt;/a&gt; as a reverse proxy.&lt;/p&gt;
&lt;p&gt;UPDATE 18/02/2024: Since writing this article I have switched to using &lt;a href=&quot;https://www.cloudflare.com/en-gb/products/tunnel/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Cloudflare Tunnels&lt;/a&gt; which removes some complexity mentioned in this article.&lt;/p&gt;
&lt;h2 id=&quot;a-note-about-my-chosen-cloudflare-setup&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#a-note-about-my-chosen-cloudflare-setup&quot;&gt;#&lt;/a&gt;A note about my chosen Cloudflare setup&lt;/h2&gt;
&lt;p&gt;First off I think it is important to note that I am using the Full (strict) &lt;a href=&quot;https://developers.cloudflare.com/ssl/origin-configuration/ssl-modes/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;encryption mode&lt;/a&gt; in Cloudflare. I already had traefik setup to automatically generate SSL certificates via LetsEncrypt so it made the most sense to me. I am now also using a &lt;a href=&quot;https://ssl-config.mozilla.org/#server=traefik&amp;amp;version=2.1.2&amp;amp;config=modern&amp;amp;guideline=5.6&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;modern &lt;/a&gt;SSL setup as my only clients in the Cloudflare proxy scenario are the proxy servers themselves which support TLS 1.3 just fine.&lt;/p&gt;
&lt;p&gt;Personally I think you should be using either Full or Full (strict) encryption modes so that your client’s connections are secure all of the way to your origin server. Though if you are determined to use the less secure modes, you can utilise the &lt;a href=&quot;https://doc.traefik.io/traefik/middlewares/http/ipwhitelist/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;IPWhiteList middleware&lt;/a&gt; in traefik and whitelist &lt;a href=&quot;https://www.cloudflare.com/en-gb/ips/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Cloudflares ranges&lt;/a&gt; to only allow Cloudflare proxy traffic.&lt;/p&gt;
&lt;p&gt;Now onto the fun stuff…&lt;/p&gt;
&lt;h2 id=&quot;securing-https-traffic&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#securing-https-traffic&quot;&gt;#&lt;/a&gt;Securing HTTPS traffic&lt;/h2&gt;
&lt;p&gt;You might think that simply switching your DNS to Cloudflare, enabling proxying and leaving it at that is good enough. However, if you’re using Cloudflare to hide your origin server you’ll want to go a step further as a determined attacker could still potentially discover your origin server.&lt;/p&gt;
&lt;p&gt;To demonstrate this we can run the following curl command:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;curl&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --resolve&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; www.benscobie.com:443:originserverip&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; https://www.benscobie.com/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What we’re doing here is sending an SNI-compliant request directly to the origin web server (traefik). And surprise surprise we get a response:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;text&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;* Added benscobie.com:443:x.x.x.x to DNS cache&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;* Hostname benscobie.com was found in DNS cache&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;*   Trying x.x.x.x:443...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;* Connected to benscobie.com (x.x.x.x) port 443 (#0)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;* schannel: disabled automatic use of client certificate&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;* ALPN: offers http/1.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;* ALPN: server accepted http/1.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;gt; GET / HTTP/1.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;gt; Host: www.benscobie.com&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;gt; User-Agent: curl/7.83.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;gt; Accept: */*&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;* Mark bundle as not supporting multiuse&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; HTTP/1.1 200 OK&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Accept-Ranges: bytes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Content-Security-Policy: default-src &amp;#39;self&amp;#39;; script-src &amp;#39;self&amp;#39; &amp;#39;unsafe-eval&amp;#39; … img-src * data:; font-src &amp;#39;self&amp;#39; data: fonts.gstatic.com; …&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Content-Type: text/html; charset=UTF-8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Date: Sat, 27 Aug 2022 16:13:45 GMT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Etag: &amp;quot;21b4-5e73a7d2dcb0f&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Last-Modified: Sat, 27 Aug 2022 15:14:37 GMT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Permissions-Policy: accelerometer=(), ambient-light-sensor=(), autoplay=(), … picture-in-picture=(), speaker=(), usb=(), vr=()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Referrer-Policy: no-referrer-when-downgrade&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Strict-Transport-Security: max-age=63072000; includeSubDomains; preload&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Vary: X-Forwarded-Proto,Accept-Encoding&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; X-Content-Type-Options: nosniff&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; X-Frame-Options: SAMEORIGIN&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; X-Xss-Protection: 1; mode=block&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Transfer-Encoding: chunked&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;* schannel: failed to decrypt data, need more data&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt;html lang=&amp;quot;en-GB&amp;quot; class=&amp;quot;no-js&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;…&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What does this mean for us? Simply put, an attacker could iterate over the entire worlds IP space (really not that hard to do these days if using IPv4!) and send the same exact request. Eventually they’ll hit your origin server and/or Cloudflare, and as their IP ranges are public it won’t be hard to figure out which of those is the origin server.&lt;/p&gt;
&lt;p&gt;To fix this we’re going to enable Cloudflare’s &lt;a href=&quot;https://developers.cloudflare.com/ssl/origin-configuration/authenticated-origin-pull/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;authenticated origin pulls&lt;/a&gt;. With this we can validate that requests come from the Cloudflare network.&lt;/p&gt;
&lt;p&gt;Navigate to the &lt;a href=&quot;https://developers.cloudflare.com/ssl/origin-configuration/authenticated-origin-pull/set-up/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;setup page&lt;/a&gt;, under the section Zone-Level Authenticated Origin Pull using Cloudflare certificate, download the .PEM file and put this somewhere where traefik can access it.&lt;/p&gt;
&lt;p&gt;Next, configure &lt;a href=&quot;https://doc.traefik.io/traefik/https/tls/#client-authentication-mtls&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;traefik client authentication (mTLS)&lt;/a&gt;. I’m using yml dynamic configuration which looks like the following:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;yaml&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A&quot;&gt;tls&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A&quot;&gt;  options&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A&quot;&gt;    default&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A&quot;&gt;      sniStrict&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A&quot;&gt;      clientAuth&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A&quot;&gt;        caFiles&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;          - &lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;/opt/traefik/certs/authenticated_origin_pull_ca.pem&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#22863A&quot;&gt;        clientAuthType&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;RequireAndVerifyClientCert&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I’m also enabling &lt;a href=&quot;https://doc.traefik.io/traefik/https/tls/#strict-sni-checking&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;strict SNI checking&lt;/a&gt; here to stop traefik responding with a default certificate when non-SNI requests are received.&lt;/p&gt;
&lt;p&gt;With all of that in place and running the same command again, we get the following generic error that doesn’t leak any information about the site:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;text&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_CERT_UNKNOWN (0x80090327) - An unknown error occurred while processing the certificate.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;So that’s HTTPS traffic sorted out, but what about HTTP traffic?&lt;/p&gt;
&lt;h2 id=&quot;securing-http-traffic&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#securing-http-traffic&quot;&gt;#&lt;/a&gt;Securing HTTP traffic&lt;/h2&gt;
&lt;p&gt;Let’s run the following command to send a HTTP request directly to our origin server:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;curl&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; -v&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; -H&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;Host: benscobie.com&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; http://originserverip&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The response looks like this:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;text&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;gt; GET / HTTP/1.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;gt; Host: www.benscobie.com&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;gt; User-Agent: curl/7.83.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;gt; Accept:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;*/*&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;* Mark bundle as not supporting multiuse&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; HTTP/1.1 301 Moved Permanently&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Location: https://www.benscobie.com/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Date: Sat, 27 Aug 2022 16:46:53 GMT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Content-Length: 17&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt; Content-Type: text/plain; charset=utf-8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Moved Permanently*&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Connection #0 to host x.x.x.x left intact&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What’s happening here is that the browser is being told to redirect to our site using the HTTPs protocol, is a pretty standard thing to do these days. This falls foul to the same attack I mentioned previously whereby an attacker can iterate over IPs until they hit a response like this. They’d need only to validate that the Location contains the target domain.&lt;/p&gt;
&lt;p&gt;Cloudflare can handle the redirection of HTTP to HTTPS for us &lt;a href=&quot;https://developers.cloudflare.com/ssl/edge-certificates/additional-options/always-use-https/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;so enable that&lt;/a&gt;. Once you’ve done this there shouldn’t be any reason to respond to HTTP traffic from the origin server, you can simply stop traefik listening on port 80 or disable that entrypoint in the traefik router.&lt;/p&gt;
&lt;h2 id=&quot;closing-words&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#closing-words&quot;&gt;#&lt;/a&gt;Closing words&lt;/h2&gt;
&lt;p&gt;That’s it for the traefik and Cloudflare setup. There are more ways for an attacker to discover your origin server but resolving these is not in scope, but here are a few to keep in mind:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sending emails directly from your origin server will leak its IP address. Use an email sending service like &lt;a href=&quot;https://sendgrid.com/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;SendGrid &lt;/a&gt;or &lt;a href=&quot;https://www.mailgun.com/&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Mailgun&lt;/a&gt; instead.&lt;/li&gt;
&lt;li&gt;Making server-side network requests based on user input could leak your origin server’s IP address. E.g. you have a utility to set a profile image based on a user provided URL.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I hope that this helped you in some way. Let me know if there’s something I could do to further improve my security posture here as I’m always looking to learn.&lt;/p&gt;</content:encoded></item><item><title>AWS Lambda LocalStack – Cannot assign requested address: HttpRequestException</title><link>https://www.benscobie.com/posts/aws-lambda-localstack-cannot-assign-requested-address-httprequestexception/</link><guid isPermaLink="true">https://www.benscobie.com/posts/aws-lambda-localstack-cannot-assign-requested-address-httprequestexception/</guid><description>Fix LocalStack Lambda HttpRequestException by pointing AWS clients at host.docker.internal and the correct edge port.</description><pubDate>Mon, 08 Aug 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I found myself hitting the following exception whilst playing around with AWS Lambda and LocalStack when invoking a Lambda function from another Lambda function:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;text&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Cannot assign requested address: HttpRequestException&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.HttpHandler`1.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.Unmarshaller.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync[T](IExecutionContext executionContext)localstack_main  |    at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext)localstack_main  |    at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;localstack_main  |    at FanOutFunction.Function.FunctionHandler(Stream stream, ILambdaContext context) in C:\Git\MyApp\src\FanOutFunction\Function.cs:line 86&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Lambdas in LocalStack run within Docker so the AWS endpoint should to be set to the LocalStack container which wasn’t the case for me. As the LocalStack edge port is typically exposed you can just target the docker host by using host.docker.internal&lt;/p&gt;
&lt;p&gt;I am using the &lt;a href=&quot;https://github.com/localstack-dotnet/localstack-dotnet-client&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;.NET LocalStack client&lt;/a&gt; so this looks like the following:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-title&quot;&gt;appsettings.json&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;json&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;  &amp;quot;LocalStack&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;    &amp;quot;UseLocalStack&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;    &amp;quot;Session&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B31D28;font-style:italic&quot;&gt;      ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;    &amp;quot;Config&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;      &amp;quot;LocalStackHost&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;&amp;quot;host.docker.internal&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;      &amp;quot;UseSsl&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;      &amp;quot;UseLegacyPorts&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;      &amp;quot;EdgePort&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;4566&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After pointing at &lt;code&gt;host.docker.internal&lt;/code&gt;, the Lambda client could reach the LocalStack services consistently.&lt;/p&gt;</content:encoded></item><item><title>Build &amp; deploy ASP.NET Core applications with Jenkins and Octopus Deploy</title><link>https://www.benscobie.com/posts/build-deploy-asp-net-core-applications-jenkins-octopus-deploy/</link><guid isPermaLink="true">https://www.benscobie.com/posts/build-deploy-asp-net-core-applications-jenkins-octopus-deploy/</guid><description>Build and publish an ASP.NET Core app in Jenkins, package it with Octo CLI, and push releases to Octopus Deploy for automated deployments.</description><pubDate>Tue, 10 Jan 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;After recently getting to grips with Jenkins I wanted to expand into deployment automation as that was the only stage missing from my workflow. At my current place of work, we use Octopus Deploy for all of our in-house application deployments and it works flawlessly so I threw up an Octopus VM in Azure to play with. What we want to end up with is Jenkins building our ASP.NET Core application from source, packaging the published output and then pushing that package to Octopus for it to deploy.&lt;/p&gt;
&lt;p&gt;Disclaimer: This is my first educational blog post so hopefully I’ve made it relatively easy to follow. I’m always looking to enhance my writing skills so let me know in the comments if I can improve anywhere or if I’ve made any mistakes.&lt;/p&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#prerequisites&quot;&gt;#&lt;/a&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;First, if you haven’t already got the .NET Core SDK installed on your build server(s), follow the &lt;a href=&quot;https://www.microsoft.com/net/core&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;.NET Core installation guide&lt;/a&gt; for your OS. Remember to install the version your application targets. If you don’t have admin access to do this, you can look into the &lt;a href=&quot;https://docs.microsoft.com/en-us/dotnet/articles/core/tools/dotnet-install-script&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;dotnet-install scripts&lt;/a&gt; which can be used to perform a non-admin install of the CLI toolchain and the shared runtime.&lt;/p&gt;
&lt;p&gt;Next, we need to grab the Octo.exe command line tool to package our build output. Typically, we would use the OctoPack NuGet package but it does &lt;a href=&quot;http://help.octopusdeploy.com/discussions/problems/47947-net-core-deployment#comment_40960538&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;not support .NET Core&lt;/a&gt;. Instead, we can use the Octo command line tool which just so happens to be built on .NET Core so we can run it on almost anything!&lt;/p&gt;
&lt;p&gt;Hop on over to the &lt;a href=&quot;https://octopus.com/downloads&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;downloads page&lt;/a&gt; for Octopus Deploy and download the relevant Command Line package for your distribution. As of January 2017 the Octo CLI tool is currently targeting .NET Core 1.0.0 so you may need to install the .NET Core 1.0.0 runtime if you haven’t already done so in the previous step. Optionally, you can grab the .NET Core package which includes the required runtimes.&lt;/p&gt;
&lt;p&gt;Extract the package to a place of your choosing. As my build server is running Linux I’ve gone with: &lt;code&gt;/opt/octopus/cli/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That’s all of the prerequisites out of the way, now let’s head on over to Jenkins and set up a new build.&lt;/p&gt;
&lt;h2 id=&quot;setting-up-jenkins-pt1&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#setting-up-jenkins-pt1&quot;&gt;#&lt;/a&gt;Setting up Jenkins Pt.1&lt;/h2&gt;
&lt;p&gt;I started off by creating a new freestyle project job for my ASP.NET Core application and pointed it at my git repository. I’ve also set this job up to be executed by GitLab when I push new code. I am going to assume you already know how to set up the SCM parts of the build and jump straight to the actual build itself.&lt;/p&gt;
&lt;p&gt;The first thing you’ll want to do is add a new execute shell build step which we’ll use to build and publish the ASP.NET application. You can also run your unit tests here if you have them. This is what my build step looks like:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;dotnet&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; restore&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;dotnet&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; build&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --configuration&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;Release&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;dotnet&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; publish&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --configuration&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;Release&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; src/Website/Website.csproj&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --output&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; published-website&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here’s a breakdown of each step:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Restore the dependencies and tools of the project.&lt;/li&gt;
&lt;li&gt;Build all projects with an extension ending in proj using the Release configuration.&lt;/li&gt;
&lt;li&gt;Publish the ASP.NET Core application using the Release configuration to the “published-website” directory.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There’s various other commands and options you can use here so be sure to check out the &lt;a href=&quot;https://docs.microsoft.com/en-us/dotnet/articles/core/tools/dotnet#dotnet-commands&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;At this stage, it would be a good idea to test the build job to make sure everything works so far. Hopefully everything went okay for you, if not, leave a comment here and I’ll try to help you out. There’s always Google too.&lt;/p&gt;
&lt;h2 id=&quot;setting-up-octopus-pt1&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#setting-up-octopus-pt1&quot;&gt;#&lt;/a&gt;Setting up Octopus Pt.1&lt;/h2&gt;
&lt;p&gt;Now that we have a successfully building application we next need to package up our published ASP.NET Core application and push it to the &lt;a href=&quot;https://octopus.com/docs/packaging-applications/package-repositories#Packagerepositories-Usingthebuilt-inrepository&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Octopus built-in repository&lt;/a&gt;. I use the built-in repository as it doesn’t require any set up and it just makes sense to keep the things we want to deploy with the deployment tool. We’ll need to set up a few things in Octopus Deploy to achieve this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new user and set it up as a &lt;a href=&quot;https://octopus.com/docs/administration/managing-users-and-teams/service-accounts&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;service account&lt;/a&gt;. I called mine Jenkins.&lt;/li&gt;
&lt;li&gt;Create a new API key for this user and note it down as we’ll need to plug it into the Jenkins build.&lt;/li&gt;
&lt;li&gt;Finally, create a new team with the Package publisher role and add the newly created user to it.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;setting-up-jenkins-pt2&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#setting-up-jenkins-pt2&quot;&gt;#&lt;/a&gt;Setting up Jenkins Pt.2&lt;/h2&gt;
&lt;p&gt;Let’s head back on over to Jenkins and add a second Execute shell build step:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;dotnet&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; /opt/octopus/cli/Octo.dll&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; pack&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --id&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; MyProject.Website&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --version&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;${&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;BUILD_NUMBER&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --basePath&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; src/Website/published-website&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --format=zip&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;dotnet&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; /opt/octopus/cli/Octo.dll&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; push&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --package&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; MyProject.Website.&amp;quot;${&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;BUILD_NUMBER&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;}&amp;quot;.zip&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --server&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; http://octopus/&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --apiKey&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; API-YOURAPIKEY&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What we’re doing here is first packing our application into a .ZIP file by passing the Octo CLI tool a package ID, version, directory path to package and the package format. I’ve used the Jenkins BUILD_NUMBER here for the version but you can use whatever you like. Octopus used to be all about NuGets but they’ve recently started supporting ZIP which is great because I don’t think applications belong in NuGets.&lt;/p&gt;
&lt;p&gt;On the next line, we’re pushing the newly created package to the Octopus Deploy built-in repository by passing it the filename of the package we just created, our Octopus server URL and the API key of the user we created earlier on.&lt;/p&gt;
&lt;p&gt;You may want to wrap this step in a condition that this job is being executed against the master branch, for example. Otherwise you may end up with random branches being pushed as packages to Octopus. Of course you may actually want this so I recommend you look into &lt;a href=&quot;https://octopus.com/docs/key-concepts/projects/channels&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;channels&lt;/a&gt; &amp;amp; &lt;a href=&quot;https://octopus.com/docs/patterns/branching&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;branching&lt;/a&gt; on the Octopus wiki.&lt;/p&gt;
&lt;p&gt;Save &amp;amp; execute the job, wait for it to complete and then head back on over to Octopus.&lt;/p&gt;
&lt;h2 id=&quot;setting-up-octopus-pt2&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#setting-up-octopus-pt2&quot;&gt;#&lt;/a&gt;Setting up Octopus Pt.2&lt;/h2&gt;
&lt;p&gt;Navigate to the packages library in Octopus by clicking on the Library link in the navigation bar. You should now see your newly pushed package under the available packages heading!&lt;/p&gt;
&lt;p&gt;From here you can create a new project in Octopus. When setting the project up I recommend checking “Use the version number from an included package” to keep the package and release version numbers aligned. Next, add a new step to the deployment process. Many of the default website deployment templates will have the option to deploy a package from the built-in repository. After setting up your deployment process, set up any configuration values in the variables tab. Be sure to check out the documentation for &lt;a href=&quot;https://octopus.com/docs/guides/deploying-asp.net-core-web-applications/json-configuration-variables-feature&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;variable substitution in JSON files&lt;/a&gt;. Create a new release and hit that big ol’ deploy button to check that everything works as expected.&lt;/p&gt;
&lt;p&gt;Lastly, one thing I like to do with my projects is have Octopus Deploy &lt;a href=&quot;https://octopus.com/docs/deploying-applications/automatic-release-creation&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;automatically create a new release when a new package is pushed to the repository&lt;/a&gt;. I then combine this with a life cycle that has its first phase and environment set to automatically deploy when a release enters it. That way, pushing a package to the built-in repository will trigger both a release, and a deployment to that environment. I find this really useful as I can check in some code and then check the application out on a real server in just a few minutes.&lt;/p&gt;
&lt;p&gt;After getting comfortable with Jenkins, deployment was the missing piece. We already use Octopus Deploy at work, so I set up a pipeline that builds an ASP.NET Core app with Jenkins, packages the published output, and pushes it to Octopus for deployment.&lt;/p&gt;
&lt;h2 id=&quot;prerequisites-1&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#prerequisites-1&quot;&gt;#&lt;/a&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Install the .NET Core SDK on the build server (match your target version). If you lack admin rights, the &lt;code&gt;dotnet-install&lt;/code&gt; scripts work for non-admin installs.&lt;/li&gt;
&lt;li&gt;Download the Octopus CLI (Octo) from the &lt;a href=&quot;https://octopus.com/downloads&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;Octopus downloads page&lt;/a&gt; and extract it somewhere like &lt;code&gt;/opt/octopus/cli/&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;jenkins-build-step&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#jenkins-build-step&quot;&gt;#&lt;/a&gt;Jenkins build step&lt;/h2&gt;
&lt;p&gt;Create a freestyle job pointing at your git repo. The build shell step restores, builds, and publishes the app:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;dotnet&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; restore&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;dotnet&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; build&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --configuration&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;Release&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;dotnet&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; publish&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --configuration&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;Release&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; src/Website/Website.csproj&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; --output&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; published-website&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;package-and-push-to-octopus&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#package-and-push-to-octopus&quot;&gt;#&lt;/a&gt;Package and push to Octopus&lt;/h2&gt;
&lt;p&gt;Add a second shell step to package the published app and push it to the built-in Octopus repository:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;dotnet&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; /opt/octopus/cli/Octo.dll&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; pack&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;  --id&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; MyProject.Website&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;  --version&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;${&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;BUILD_NUMBER&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;  --basePath&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; src/Website/published-website&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;  --format&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; zip&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;dotnet&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; /opt/octopus/cli/Octo.dll&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; push&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;  --package&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; MyProject.Website.&amp;quot;${&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;BUILD_NUMBER&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;}&amp;quot;.zip&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;  --server&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; http://octopus/&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;  --apiKey&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; API-YOURAPIKEY&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Use a service account in Octopus with the Package Publisher role and supply its API key to Jenkins. You might restrict this step to the main branch using Jenkins conditions.&lt;/p&gt;
&lt;h2 id=&quot;octopus-setup&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#octopus-setup&quot;&gt;#&lt;/a&gt;Octopus setup&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;In Octopus, create a user for Jenkins and generate an API key.&lt;/li&gt;
&lt;li&gt;Create a team with the Package publisher role and add the user.&lt;/li&gt;
&lt;li&gt;Create a project, choose “Use the version number from an included package”, and add a deployment step to deploy from the built-in repository.&lt;/li&gt;
&lt;li&gt;Configure variables (JSON substitution is handy) and create a release. You can also enable automatic release creation when new packages arrive.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;With that in place, pushing code triggers Jenkins to build and publish, package the output, and Octopus to pick up and deploy the new release.&lt;/p&gt;</content:encoded></item><item><title>jQuery’s hide() and show() slow in Chrome</title><link>https://www.benscobie.com/posts/jquery-hide-show-slow-in-chrome/</link><guid isPermaLink="true">https://www.benscobie.com/posts/jquery-hide-show-slow-in-chrome/</guid><description>Chrome slows when toggling hundreds of elements with jQuery hide()/show(); switch to a margin-top toggle with browser detection to speed it up.</description><pubDate>Fri, 24 Aug 2012 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Whilst working on a project where I’m filtering elements on the client using JavaScript I came across a very interesting issue with Chrome.&lt;/p&gt;
&lt;p&gt;I filter elements by running jQuery’s hide() or show() on them depending on what the user entered and there’s around 750 elements that need this filtering. I noticed that this was quite slow in Chrome as it took around 2-3 seconds for the page to become responsive whilst filtering. I tested the page in Internet Explorer 9 to confirm that the code I had written was to blame, but the filtering was instant. What the hell Chrome?&lt;/p&gt;
&lt;p&gt;I then asked a friend who uses Firefox to test it out and it also filtered instantly. I did a bit of research on the subject and &lt;a href=&quot;http://stackoverflow.com/questions/4840891/jquery-hide-and-show-runs-too-slow-in-google-chrome&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;came&lt;/a&gt; &lt;a href=&quot;http://bugs.jquery.com/ticket/8092&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;across&lt;/a&gt; a few people with the same issue as well as a &lt;a href=&quot;http://code.google.com/p/chromium/issues/detail?id=71305&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;bug report&lt;/a&gt; for Chromium.&lt;/p&gt;
&lt;p&gt;One of the &lt;a href=&quot;http://stackoverflow.com/a/4841104/880839&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;answers&lt;/a&gt; on Stack Overflow had a work around that seemed to work fine for Chrome. Instead of using the hide() and show() methods I used the following (with overflow: hidden;) :&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;javascript&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;$element.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;&amp;quot;margin-top&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;// For showing&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;$element.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;&amp;quot;margin-top&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;&amp;quot;-1000000px&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;// For hiding&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Filtering was now instant again, but I remembered whilst searching for an answer I heard that negative top margins don’t work too well on older browsers. Well I fired up &lt;a href=&quot;http://www.my-debugbar.com/wiki/IETester/HomePage&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;IETester&lt;/a&gt; to give it a test in some of the older versions of Internet Explorer and they were right. The elements still showing should collapse downwards but in Internet Explorer 8 and below they don’t collapse properly, but instead gaps are left where the hidden elements once were.&lt;/p&gt;
&lt;p&gt;To fix this I ended up detecting if the user was using Chrome using my own version of the jQuery browser function which you can find below:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;javascript&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#E36209&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;	var&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt; userAgent &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt; navigator.userAgent.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;toLowerCase&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;	$.browser &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;		version: (userAgent.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;match&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;(?:rv&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;it&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;ra&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;ie)&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#22863A;font-weight:bold&quot;&gt;\/&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;: ]&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;[\d.]&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;)/&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;])[&lt;/span&gt;&lt;span style=&quot;color:#005CC5&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;		chrome:&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; /chrome/&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(userAgent),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;		safari:&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; /webkit/&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(userAgent),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;		opera:&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; /opera/&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(userAgent),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;		msie:&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; /msie/&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(userAgent) &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;/opera/&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(userAgent),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;		mozilla:&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; /mozilla/&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(userAgent) &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;/(compatible&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;webkit)/&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(userAgent),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;	};&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;})(jQuery);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And then I used the following to do the rest:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;javascript&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;javascript&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt; $cssSelector &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;display&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt; $hideCSS &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;none&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt; $showCSS &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;block&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt; ($.browser.chrome) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;	$cssSelector &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;margin-top&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;	$showCSS &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;	$hideCSS &lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; &amp;quot;-10000px&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;&amp;quot;#element&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;($cssSelector, $showCSS); &lt;/span&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;// For showing&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;&amp;quot;#element&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color:#24292E&quot;&gt;($cssSelector, $hideCSS); &lt;/span&gt;&lt;span style=&quot;color:#6A737D&quot;&gt;// For hiding&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I haven’t tested to see whether this works in earlier versions of Chrome but I can’t see it being much of an issue as Chrome automatically updates with each stable release.&lt;/p&gt;</content:encoded></item><item><title>Fixing 500 OOPS: vsftpd: refusing to run with writable root inside chroot ()</title><link>https://www.benscobie.com/posts/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/</link><guid isPermaLink="true">https://www.benscobie.com/posts/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/</guid><description>Resolve vsftpd &apos;500 OOPS: refusing to run with writable root inside chroot&apos; by removing home write permissions or enabling the writable chroot options.</description><pubDate>Sat, 07 Jan 2012 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;After upgrading vsftpd or vsftpd-ext you may be getting the following message when trying to log in.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;500 OOPS: vsftpd: refusing to run with writable root inside chroot ()&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is due to the following update:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;– Add stronger checks for the configuration error of running with a writable root directory inside a chroot(). This may bite people who carelessly turned on chroot_local_user but such is life.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The problem is that your users root directory is writable, which isn’t allowed when using chroot restrictions in the new update.&lt;/p&gt;
&lt;p&gt;To fix this you must either remove write permissions on the users root directory with the following command, replacing the directory with your users root:&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#6F42C1&quot;&gt;chmod&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; a-w&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt; /home/user&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Or you can work around this security check by adding either of the two below into your configuration file.&lt;/p&gt;
&lt;p&gt;For the standard vsFTPd build (vsftpd):&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;allow_writeable_chroot&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;YES&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;For the extended vsFTPd build (vsftpd-ext):&lt;/p&gt;
&lt;div class=&quot;code-window&quot;&gt;&lt;div class=&quot;code-window-bar&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-dot&quot;&gt;&lt;/span&gt;&lt;span class=&quot;code-window-lang&quot;&gt;bash&lt;/span&gt;&lt;/div&gt;&lt;pre class=&quot;astro-code github-light&quot; style=&quot;background-color:#fff;color:#24292e;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#24292E&quot;&gt;allow_writable_chroot&lt;/span&gt;&lt;span style=&quot;color:#D73A49&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#032F62&quot;&gt;YES&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Removing the write permission on the root isn’t a perfect solution as doing this can cause a few problems with things that need to write to the root directory, such as the bash history file or some graphical environments.&lt;/p&gt;
&lt;p&gt;Dmitriy has &lt;a href=&quot;#comment-2051&quot;&gt;suggested 3 ways&lt;/a&gt; to also overcome this problem, be sure to check them out.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;comments&quot;&gt;&lt;a class=&quot;heading-anchor&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#comments&quot;&gt;#&lt;/a&gt;Comments&lt;/h2&gt;
&lt;p class=&quot;text-sm text-slate-600&quot;&gt;101 archived comments&lt;/p&gt;&lt;ol class=&quot;comment-list&quot;&gt;&lt;li id=&quot;comment-2024&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Nick&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-10T18:38:22+00:00&quot;&gt;10 January 2012 at 6:38 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;This solution will then prevent user from uploading any files since they won’t have write access to the directory. How do you solve if the purpose of the FTP access is to allow uploading of files?&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2025&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-10T18:46:08+00:00&quot;&gt;10 January 2012 at 6:46 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;It will only prevent uploading files to the users root directory, not any sub-directories. I didn’t have this issue as I don’t write to the root directory but instead have various sub-directories for each website.&lt;/p&gt;&lt;p&gt;I’m going to assume that this is the only way of working around this unless you compile from source and remove that part of the update yourself.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2027&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Nick&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-10T20:42:56+00:00&quot;&gt;10 January 2012 at 8:42 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thanks. Seems strange to require that a person CD into a subdirectory in order to upload files. I tried setting local_root to something other than the user’s home directory — but that still creates the same error — because after the FTP connection is established it does a chroot() to that new directory. Seems like vsftpd works hard to require a person to explicitly CD into a subdirectory before uploading files. Is this some new FTP security best practice? Or just a vsftpd oddity? I haven’t tried it, but I’m guessing “virtual users” will have the same issue…&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2028&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-10T20:49:12+00:00&quot;&gt;10 January 2012 at 8:49 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;The official reason was for security: “disallow login with writable root directory because of possible glibc vulnerabilities”.&lt;/p&gt;&lt;p&gt;I was looking on the Arch linux forums and I came across a workaround, I’m not sure if this exists on other distributions though:&lt;br&gt;&lt;a href=&quot;https://bbs.archlinux.org/viewtopic.php?pid=1038842#p1038842&quot; rel=&quot;nofollow ugc&quot;&gt;https://bbs.archlinux.org/viewtopic.php?pid=1038842#p1038842&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2040&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Per Hansson&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-12T16:41:04+00:00&quot;&gt;12 January 2012 at 4:41 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;I tested this and sure it works.&lt;br&gt; But if your users are also allowed to SSH in or otherwise use tools that write files to the root of the users home directory that will fail.&lt;br&gt; Like updating history of bash/vi commands etc, like these files:&lt;br&gt; .bash_history&lt;br&gt; .bash_logout&lt;br&gt; .bash_profile&lt;br&gt; .bashrc&lt;br&gt; .viminfo&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2041&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-12T17:06:20+00:00&quot;&gt;12 January 2012 at 5:06 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;The only way to get around it currently is to compile vsftpd yourself, unless somebody can come up with a better option because I can’t think of one at the moment.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2050&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Sergey Grenivetskiy&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-13T11:35:31+00:00&quot;&gt;13 January 2012 at 11:35 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Hello, put up to config file /etc/vsftpd/vsftpd.conf option:&lt;/p&gt;&lt;p&gt;allow_writable_root=YES&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2051&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Dmitriy&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-13T12:51:03+00:00&quot;&gt;13 January 2012 at 12:51 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;you can choose one of 3 ways:&lt;br&gt; 1. Define option local_root= in configuration file. must by /home or other path to directory with users folders.&lt;br&gt; In this way vsftpd chrooting to /home directory.&lt;/p&gt;&lt;p&gt;2. Define option passwd_chroot_enable=yes in configuration file and change in /etc/passwd file user home directory from «/home/user» to «/home/./user» (w/o quotes).&lt;br&gt; In this way vsftpd chrooting to /home directory.&lt;/p&gt;&lt;p&gt;3. Download sources of vsftpd-ext, compile and overwrite exist vsftpd binaries or take it from repositories and add to configuration file option allow_writeable_root=yes.&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-3849&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Gonzalo&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-08-12T23:18:07+01:00&quot;&gt;12 August 2012 at 11:18 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Little typo in point 3.&lt;br&gt; allow_writable_root=yes&lt;br&gt; should be:&lt;br&gt; allow_writeable_root=yes&lt;br&gt; This missing e got me mad…&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-4539&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;lampwins&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-07-30T02:40:58+01:00&quot;&gt;30 July 2013 at 2:40 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;It’s actually correct, the e is not there in the -ext build, strange I know, but thats the way it is.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-4557&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;taheri&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-12-24T14:52:21+00:00&quot;&gt;24 December 2013 at 2:52 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;what if we dont want that a user see other directories in the /home directory?&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-28334&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;cserny zsolt&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2015-03-13T13:00:01+00:00&quot;&gt;13 March 2015 at 1:00 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Op.2 is working. great thanks!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-29124&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;enrico&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2015-03-24T15:14:07+00:00&quot;&gt;24 March 2015 at 3:14 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Point 2 solve my error.&lt;br&gt; Thank you Dmitriy.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-2053&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-13T14:53:39+00:00&quot;&gt;13 January 2012 at 2:53 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thanks Dmitriy, I’ve added a comment in the post about your solutions.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2060&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Chinmoy&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-14T10:56:04+00:00&quot;&gt;14 January 2012 at 10:56 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thanks!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2104&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Gerald&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-21T16:28:11+00:00&quot;&gt;21 January 2012 at 4:28 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Very sad behavior of the new vsftpd version, makes it basically unusable because /home/$user directories without write rights for the user are a joke. Defeats the entire purpose of allowing ftp access to the home directories :-(&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2228&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;mikel&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-31T22:46:47+00:00&quot;&gt;31 January 2012 at 10:46 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;In freebsd from ports 3th metod : vsftpd-ext with allow_writable_root=yes not working !&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-2229&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-31T22:47:51+00:00&quot;&gt;31 January 2012 at 10:47 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Are you using the latest vsftpd-ext?&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2517&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;uid&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-02-17T21:21:56+00:00&quot;&gt;17 February 2012 at 9:21 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;For me it works (vsFTPd version 2.3.5+ (ext.1))).&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-2230&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;mikel&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-31T22:55:13+00:00&quot;&gt;31 January 2012 at 10:55 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;yes, 2.3.5.1&lt;/p&gt;&lt;p&gt;vsftpd started with inetd:&lt;br&gt; ftp stream tcp nowait root /usr/local/libexec/vsftpd vsftpd&lt;/p&gt;&lt;p&gt;config:&lt;br&gt; anonymous_enable=NO&lt;br&gt; local_enable=YES&lt;br&gt; write_enable=YES&lt;br&gt; listen_port=21&lt;br&gt; local_umask=022&lt;br&gt; anon_upload_enable=NO&lt;br&gt; anon_mkdir_write_enable=NO&lt;br&gt; dirmessage_enable=YES&lt;br&gt; xferlog_enable=YES&lt;br&gt; connect_from_port_20=YES&lt;br&gt; xferlog_file=/var/log/vsftpd.log&lt;br&gt; xferlog_std_format=YES&lt;br&gt; hide_file=&amp;#123;/mail&amp;#125;.&lt;br&gt; secure_chroot_dir=/usr/local/share/vsftpd/empty&lt;br&gt; max_clients=200&lt;br&gt; max_per_ip=100&lt;br&gt; chroot_local_user=YES&lt;br&gt; text_userdb_names=YES&lt;br&gt; force_dot_files=YES&lt;br&gt; listen_address=xxx.xxx.xxx.xxx (my ip adress)&lt;br&gt; allow_writable_root=YES&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-2231&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-31T22:58:42+00:00&quot;&gt;31 January 2012 at 10:58 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;You could try emailing Dmitriy(the chap that runs the project I believe) for help as I have no idea what could be wrong there. His Email is at the bottom of this page: &lt;a href=&quot;http://vsftpd.devnet.ru/&quot; rel=&quot;nofollow ugc&quot;&gt; http://vsftpd.devnet.ru/ &lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-2232&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;mikel&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-01-31T23:00:51+00:00&quot;&gt;31 January 2012 at 11:00 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Oh. I agree with Gerald, very sad behaviour, I cant configure in proper way my ftp server, it`s terrible.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2247&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Per Hansson&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-02-02T17:55:40+00:00&quot;&gt;2 February 2012 at 5:55 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;mikel; can’t you add this directive to your conf instead of using “allow_writeable_root”&lt;br&gt; local_root=/home&lt;br&gt; Or one of the other options posted by dmitriy?&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2397&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Massimo Lusetti&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-02-08T18:00:53+00:00&quot;&gt;8 February 2012 at 6:00 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;The only thing you have to do is treat users home as users home and put everything inside a dedicate directory, like the public_html used to accomplish.&lt;/p&gt;&lt;p&gt;BTW the FreeBSD works like a charm.&lt;/p&gt;&lt;p&gt;Cheers&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-3381&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;pwm&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-05-08T14:44:00+01:00&quot;&gt;8 May 2012 at 2:44 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;I agree with Massimo, the easiest way to deal with this imho is to move everything into a writable subdir, then chmod a-w the root dir. (can be a bit of a pain in the ass for loads of virtual users, but works)&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-2952&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;quimkaos&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-03-25T13:56:41+01:00&quot;&gt;25 March 2012 at 1:56 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;the option chmod a-w /home/user doesn’t work in an graphical environment, since it will prevent system from loading/writing some crucial files.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-2965&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;MFB&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-03-27T06:33:51+01:00&quot;&gt;27 March 2012 at 6:33 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Option 1 worked for me, thanks&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3113&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Antar Iliev&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-04-10T16:08:34+01:00&quot;&gt;10 April 2012 at 4:08 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;One tip for anyone having trouble with this:&lt;/p&gt;&lt;p&gt;At some point during my fooling around, my system (Ubuntu 12.04) stopped looking at /etc/vsftpd.conf–any changes I made were COMPLETELY ignored.&lt;/p&gt;&lt;p&gt;If that happens to you, copy your config file over to /etc/vsftpd/vsftpd.conf (you’ll probably need to make the directory).&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3252&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;flet&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-04-24T07:59:35+01:00&quot;&gt;24 April 2012 at 7:59 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;chmod a-w /usr/local/share/vsftpd/empty&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3321&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;wally&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-04-30T03:55:51+01:00&quot;&gt;30 April 2012 at 3:55 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Dmitriy’s #1` suggestion worked perfectly.&lt;br&gt; I added the line local_root=/home/wally/Public to the vsftpd.conf file and I ‘connect to server’ in Nautilus using that address location.&lt;br&gt; Once there, I bookmark that location and it is not only always there in Nautilus, but also directly from the Unity launcher (using Ubuntu 12.4). by right clicking the file icon. This connects to the Public folder that is installed by default by Ubuntu, but you could point to any other subfolder just as easily… jut not to the home folder itself. Really quick and easy.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3334&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Alexandr&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-05-01T12:42:02+01:00&quot;&gt;1 May 2012 at 12:42 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;blockquote&gt;&lt;p&gt; cat /etc/vsftpd.conf&lt;br&gt; listen=YES&lt;br&gt; anonymous_enable=NO&lt;br&gt; local_enable=YES&lt;br&gt; write_enable=YES&lt;br&gt; local_umask=002&lt;br&gt; dirmessage_enable=YES&lt;br&gt; use_localtime=YES&lt;br&gt; xferlog_enable=YES&lt;br&gt; connect_from_port_20=YES&lt;br&gt; vsftpd_log_file=/var/log/vsftpd.log&lt;br&gt; xferlog_std_format=YES&lt;br&gt; chroot_list_enable=YES&lt;br&gt; chroot_list_file=/etc/vsftpd.chroot_list&lt;br&gt; secure_chroot_dir=/var/run/vsftpd/empty&lt;br&gt; pam_service_name=vsftpd&lt;/p&gt;&lt;p&gt;userlist_enable=YES&lt;br&gt; tcp_wrappers=YES&lt;br&gt; pasv_promiscuous=YES&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;in /etc/vsftpd.chroot_list add user to chroot,&lt;br&gt; add “/usr/sbin/nologin” to /etc/shells &amp;amp; add :/usr/sbin/nologin in /etc/passwd&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-4533&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;MasEDI&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-06-20T21:44:41+01:00&quot;&gt;20 June 2013 at 9:44 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;awesome, your solution is work for me (Ubuntu 12.04) almost a day fixing the error :(&lt;/p&gt;&lt;p&gt;I add&lt;/p&gt;&lt;p&gt;chroot_list_enable=YES&lt;br&gt; chroot_list_file=/etc/vsftpd.chroot_list&lt;/p&gt;&lt;p&gt;and add user to /etc/vsftpd.chroot_list&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-3358&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;dE_logics&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-05-05T08:42:53+01:00&quot;&gt;5 May 2012 at 8:42 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;And why are such restrictions added?&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-3360&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-05-05T14:29:16+01:00&quot;&gt;5 May 2012 at 2:29 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;The official reason is “Disallow login with writable root directory because of possible glibc vulnerabilities”&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-3480&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Brian K. White&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-05-20T05:55:13+01:00&quot;&gt;20 May 2012 at 5:55 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;I have a ton of business critical EDI transactions between my customers, and vendors and customers of my customers, all going to and from a bunch of different 24/7 production application servers, The remote people aren’t even my customers but customers of my customes and vendors of my costomers. These countless oddball custom automated procedures have been accumulating for years, and NOW all of the sudden they all break when I update vsftpd or update a whole server, or just install a new server and try to move customers onto it. It’s completely impractical to find all the people on the remote sides and get them to change their scripts and programs to change the paths to use subdirectories, let alone that we’d have to update countless scripts and programs on our side to match.&lt;/p&gt;&lt;p&gt;Out here in the real world this wonderful thoughtful caring change basically means I have to TURN OFF CHROOT on a bunch of publicly accessible servers…&lt;/p&gt;&lt;p&gt;Anyways, thanks for the pointer to the -ext fork. Since my boxes are all opensuse and since I already maintain several other special packages in an opensuse build service project, at least I can relatively easily package up that -ext fork and get it distributed and installed and turn chroot back on.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3486&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;paul&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-05-21T01:16:10+01:00&quot;&gt;21 May 2012 at 1:16 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Guys check out this link…&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://serverfault.com/questions/384439/ubuntu-12-04-howto-downgrade-vsftpd/390887#390887&quot; rel=&quot;nofollow ugc&quot;&gt;http://serverfault.com/questions/384439/ubuntu-12-04-howto-downgrade-vsftpd/390887#390887&lt;/a&gt;&lt;/p&gt;&lt;p&gt;click on the “pool” hyperlink to download the earlier versions of vsftpd…&lt;/p&gt;&lt;p&gt;This works a treat having spent all day invesitigating this problem with 12.04 and the latest devil version of vsftpd 2.3.5!!! Just mysql to sort out now!!! :D&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3494&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Brian K. White&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-05-21T21:26:32+01:00&quot;&gt;21 May 2012 at 9:26 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Good News!&lt;/p&gt;&lt;p&gt;Stock vsftpd 3.0.0 includes a new config option:&lt;/p&gt;&lt;p&gt;allow_writeable_chroot=YES&lt;/p&gt;&lt;p&gt;I was in the process of extracting just that option out of the full -ext patches, and discovered that particular feature is already in stock 3.0.0 with a slightly different name than in -ext.&lt;/p&gt;&lt;p&gt;dev1:oh7:~/src/vsftpd-3.0.0 # grep allow_writeable_chroot *&lt;br&gt; Changelog:- Add new config setting “allow_writeable_chroot” to help people in a bit of&lt;br&gt; parseconf.c: &amp;#123; “allow_writeable_chroot”, &amp;amp;tunable_allow_writeable_chroot &amp;#125;,&lt;br&gt; tunables.c:int tunable_allow_writeable_chroot;&lt;br&gt; tunables.c: tunable_allow_writeable_chroot = 0;&lt;br&gt; tunables.h:extern int tunable_allow_writeable_chroot; /* Allow misconfiguration */&lt;br&gt; twoprocess.c: if (!was_anon &amp;amp;&amp;amp; tunable_allow_writeable_chroot)&lt;br&gt; dev1:oh7:~/src/vsftpd-3.0.0 #&lt;/p&gt;&lt;p&gt;One thing: I noticed that the 3.0.0 source has a writeable chroot change in twoprocess.c but not in oneprocess.c, while the 2.3.5-ext source has writable chroot changes in both oneprocess.c and twoprocess.c. I have verified that the new option works in the default two-process mode on stock 3.0.0. I have not verified that it works in one-process mode.&lt;/p&gt;&lt;p&gt;—&lt;br&gt; bkw&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-3495&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-05-21T21:33:10+01:00&quot;&gt;21 May 2012 at 9:33 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thanks Brian, I’ve updated my post to reflect this new config option, hopefully it’ll give people a few more options to choose from!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-3554&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Henry&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-05-27T00:37:29+01:00&quot;&gt;27 May 2012 at 12:37 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;I was also trying for hours to setup my 12.04 server access to allow me to upload pages via ftp on the LAN. After clearing the 530 error, I was stuck on the error this thread is addressing. Solution: follow the suggestion #1 of Dmitriy and Massimo. Finally the answer was simple. Place the ftp home directory in a directory which you have removed write permission for. Point to that directory in vsftpd.confi.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3813&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;eXoRt&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-06-18T19:37:24+01:00&quot;&gt;18 June 2012 at 7:37 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;@Brian K. White&lt;br&gt; I try running vsftpd version 3.0 with allow_writable_chroot=YES and it won’t start. Same behavior with the previous version 2.3.5&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-3814&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-06-18T19:38:39+01:00&quot;&gt;18 June 2012 at 7:38 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Try using vsftpd-ext instead.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-3828&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Igor Levicki&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-06-20T10:52:22+01:00&quot;&gt;20 June 2012 at 10:52 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;&amp;gt;&amp;gt;This may bite people who carelessly turned on chroot_local_user but such is life.&lt;/p&gt;&lt;p&gt;The above sentence nicely sums up the sheer arrogance of open-source community who obviously believes that if something they produce is free they don’t have any liability when they introduce a breaking change and that we should not assume that next version will work as it did or at all.&lt;/p&gt;&lt;p&gt;Whoever thought of that change is a shortsighted moron who didn’t think about all possilbe user scenarios out there.&lt;/p&gt;&lt;p&gt;People posting before me have already commented that this will break even standard Linux use (desktop/shell) so I won’t comment on that further.&lt;/p&gt;&lt;p&gt;In my case, I have a NAS box at home running Samba and FTP. I do not use my own user home directory in classical Linux way — it exists solely for Samba and FTP. It is completely normal to be able to write to my own root directory. If I can’t write into it, then I cannot create folders. I don’t want anyone forcing me to change my folder hierarchy and have one redundant level added to please someone’s security concerns.&lt;/p&gt;&lt;p&gt;If there really is a glibc vulnerability which is a reason for this change, why not fix that instead???&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3836&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ashe&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-07-17T09:49:33+01:00&quot;&gt;17 July 2012 at 9:49 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Hi!&lt;/p&gt;&lt;p&gt;I’m trying to compile vsftpd-ext but i can’t:&lt;/p&gt;&lt;p&gt;/usr/bin/ld: cannot find -lcap&lt;br&gt; /usr/bin/ld: cannot find -lpam&lt;br&gt; /usr/bin/ld: cannot find -lwrap&lt;/p&gt;&lt;p&gt;in Ubuntu server 12.04&lt;/p&gt;&lt;p&gt;Any ideas?&lt;/p&gt;&lt;p&gt;Thanks.&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-3837&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-07-17T10:24:55+01:00&quot;&gt;17 July 2012 at 10:24 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;You’re missing some libraries/packages. A quick Google turned up this thread which you may need to translate:&lt;br&gt;&lt;a href=&quot;http://forum.ubuntuusers.de/post/4552752/&quot; rel=&quot;nofollow ugc&quot;&gt;http://forum.ubuntuusers.de/post/4552752/&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-3842&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Hannes&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-07-18T09:12:56+01:00&quot;&gt;18 July 2012 at 9:12 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;I installed a new ubuntu 12.04 box for our customers transfering their data per ftp to our service.&lt;br&gt; At first vsftpd answered any ftp-login with “530 Login incorrect.” after googling and an annoying “apt-get remove vsftpd ; rm /etc/pam.d/vsftpd ; apt-get install vsftpd” a login was possible but we were locked out by “500 OOPS: vsftpd: refusing to run with writable root inside chroot()”&lt;/p&gt;&lt;p&gt;For me Dmitriys solution #2 workes perfect.&lt;br&gt; I added the option passwd_chroot_enable=YES and changed every users home directory from «/home/user» to «/home/./user» (w/o quotes) in /etc/passwd. “vi +’:1,$ s/home/home\/.’ /etc/passwd”&lt;br&gt; In this way vsftpd workes as usual.&lt;/p&gt;&lt;p&gt;But I do not understand what is wrong in using ftp this way – creating users without a shell in etc/passwd and chrooting them to their own home directory without a subfolder, because ftp is the only thing they can do. Maybe someone can give me a hint what I have done wrong using ftp in that way for more than a decade. So I hopefully can set up my ftp boxes accurate.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3844&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Arley&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-07-23T10:32:55+01:00&quot;&gt;23 July 2012 at 10:32 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;comment this lines, and working,&lt;/p&gt;&lt;p&gt;#chown_uploads=YES&lt;br&gt; #chown_username=whoever&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3846&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;quimkaos&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-07-31T06:38:54+01:00&quot;&gt;31 July 2012 at 6:38 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;the first option presented by Dmitriy works, but can i hide the other users folders, since if i have more than one user and set local_root=/home, any user will be able to see and browse the others users home folder?&lt;br&gt; or can i set the local_root (or any other option) using environment variables? so i can restrict users to a folder inside they home dir? for instance i would like to set local_root=$HOME/ftp and have the restricted there…&lt;/p&gt;&lt;p&gt;hope i made myself clear…&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3851&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;David&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-08-17T16:53:49+01:00&quot;&gt;17 August 2012 at 4:53 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;The solutions either don’t work (i.e. allow_writable_chroot=YES) or are unacceptable.&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-3852&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-08-17T16:55:23+01:00&quot;&gt;17 August 2012 at 4:55 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;allow_writeable_root instead of allow_writable_chroot&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-3854&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Byron&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-08-31T22:02:34+01:00&quot;&gt;31 August 2012 at 10:02 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Could not get allow_writeable_chroot or use Dmitry’s suggestion of changing the chroot in the vsftpd.conf .&lt;/p&gt;&lt;p&gt;What worked was disabling write access to the user’s home directory, and adding a folder within (similar to what Hannes has done).&lt;/p&gt;&lt;p&gt;sudo adduser test&lt;br&gt; ##Restrict Shell Access&lt;br&gt; sudo usermod test -s /usr/sbin/nologin&lt;br&gt; ##Add to ftp allowed list&lt;br&gt; sudo nano /etc/vsftpd.userlist&lt;br&gt; ##Remove write access to home directory&lt;br&gt; sudo chmod u-w /home/test&lt;br&gt; ##Make directory “inside” home directory&lt;br&gt; sudo mkdir /home/test/inside&lt;br&gt; ##Give test ownership of directory&lt;br&gt; sudo chown test /home/test/inside&lt;br&gt; ## Change group to test&lt;br&gt; sudo chgrp test /home/test/inside&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3937&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Aron&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-09-18T11:54:56+01:00&quot;&gt;18 September 2012 at 11:54 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;I can only support what Igor Levicki said, the only who is acting “carelessly” here is the author of vsftpd:&lt;br&gt; A) Introducing breaking changes into a minor software update 2.3.&lt;b&gt;5&lt;/b&gt; is a very bad idea. My vsftpd server neither understands allow_writeable_root, nor allow_writable_root, nor allow_writeable_chroot, nor allow_writable_chroot and that I have to patch and recompile vsftpd to get it working again is supposed to be a joke.&lt;br&gt; B) Until today there has been given no justification for this breaking change, except dubious claims about a supposed vulnerability in libc. Please provide some information about this vulnerability and example code how it can be exploited.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-3991&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;dangermse&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-09-26T16:39:06+01:00&quot;&gt;26 September 2012 at 4:39 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Just a note that this issue causes what appear to be ssl problems when you have ssl enabled in vsftpd. An upgrade from opensuse 12.1 to 12.2 caused this problem for me but was hidden behind an ssl_read: wrong version number error when using lftp. To find out that this was the real issue I had to first set enable_ssl=No. After that I got the error above and google led me here. The allow_writeable_chroot=Yes fixed my issues.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4044&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Dino Nardini&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-10-15T19:08:52+01:00&quot;&gt;15 October 2012 at 7:08 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;My solution… rolling back to 2.0.5. Maybe I’ll look at upgrading again once the author pulls his head outta his ass, thanks.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4045&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;borgotech&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-10-15T20:02:09+01:00&quot;&gt;15 October 2012 at 8:02 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;For me (&lt;strong&gt;FreeBSD 9.0 x64&lt;/strong&gt;) it works with this vsftpd.conf&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt; anonymous_enable=NO&lt;br&gt; local_enable=YES&lt;br&gt; write_enable=YES&lt;br&gt; local_umask=022&lt;br&gt; anon_upload_enable=NO&lt;br&gt; anon_mkdir_write_enable=NO&lt;br&gt; dirmessage_enable=YES&lt;br&gt; xferlog_enable=YES&lt;br&gt; connect_from_port_20=YES&lt;br&gt; xferlog_file=/var/log/vsftpd.log&lt;br&gt; nopriv_user=vsftpd&lt;/p&gt;&lt;p&gt;chroot_local_user=YES&lt;br&gt; secure_chroot_dir=/usr/local/share/vsftpd/empty&lt;br&gt; listen=YES&lt;/p&gt;&lt;p&gt;pasv_enable=YES&lt;br&gt; pasv_addr_resolve=YES&lt;br&gt; pasv_address=myhosh.mydomain&lt;/p&gt;&lt;p&gt;pasv_min_port=50000&lt;br&gt; pasv_max_port=50100&lt;/p&gt;&lt;p&gt;pam_service_name=vsftpd&lt;br&gt; guest_enable=YES&lt;br&gt; guest_username=vsftpd&lt;br&gt; local_root=/home/vsftpd/$USER&lt;br&gt; user_sub_token=$USER&lt;br&gt; virtual_use_local_privs=YES&lt;br&gt; user_config_dir=/usr/local/etc/vsftpd_user_conf&lt;br&gt; allow_writeable_chroot=YES&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Thank &lt;strong&gt;Brian K. White; Dimitiy&lt;/strong&gt;…and al of you&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4048&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Mark&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-10-18T03:29:55+01:00&quot;&gt;18 October 2012 at 3:29 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;For those of you running Ubuntu 12.04, I have created a &lt;a href=&quot;https://launchpad.net/~thefrontiergroup/+archive/vsftpd&quot; rel=&quot;nofollow&quot;&gt;vsftpd 2.3.5 PPA&lt;/a&gt; that backports the allow_writeable_chroot config option from vsftpd 3 to the existing Ubuntu package. To use it:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;sudo add-apt-repository ppa:thefrontiergroup/vsftpd&lt;br&gt; sudo apt-get update&lt;br&gt; sudo apt-get install vsftpd&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-4092&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Chris Hough&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-01-12T23:35:05+00:00&quot;&gt;12 January 2013 at 11:35 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;@Mark&lt;/p&gt;&lt;p&gt;I wanted to say let me know where I can send you a beer! I mean that. I owe you one.&lt;/p&gt;&lt;p&gt;After spending hours on this b.s. problem I finally found your solution and so far it’s testing perfectly and I am compiling a post about it. I encountered this b.s. in setting up a new Rackspace Cloud LEMP box: &lt;a href=&quot;http://noconformity.com/blog/2013/01/09/rackspace-cloud-setup-ubuntu-12-04-lemp-server/&quot; rel=&quot;nofollow ugc&quot;&gt;http://noconformity.com/blog/2013/01/09/rackspace-cloud-setup-ubuntu-12-04-lemp-server/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I hope you have a great start to the year.&lt;/p&gt;&lt;p&gt;@chrishough&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4254&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Dave H&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-01-25T08:24:00+00:00&quot;&gt;25 January 2013 at 8:24 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thanks Mark! This is perfect for 12.04.1 LTS&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4521&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Tim&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-02-27T23:19:56+00:00&quot;&gt;27 February 2013 at 11:19 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Mark, you’re the man.&lt;/p&gt;&lt;p&gt;This was the only solution I found to work for Ubuntu 12.04.&lt;/p&gt;&lt;p&gt;Thanks very much&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4525&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Kat&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-04-03T15:03:26+01:00&quot;&gt;3 April 2013 at 3:03 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;You are wonderful Mark! Thank you, I’ve been attempting to solve this problem for ages!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4527&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Cappo75&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-05-09T07:29:59+01:00&quot;&gt;9 May 2013 at 7:29 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;thankyou Mark!&lt;br&gt; you saved me!&lt;/p&gt;&lt;p&gt;Cappo&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4532&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Chris&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-06-19T11:27:48+01:00&quot;&gt;19 June 2013 at 11:27 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Hey Mark,&lt;/p&gt;&lt;p&gt;I know this thread is old and all, but I wanted to thank you for this solution. You’re the knight in shining armor, and I’ll name my firstborn after you, no matter if it’s a boy or a girl. Actually, I’m gonna name ALL my children after you, and all my pets. My cats better get used to being called Mark from now on. I’ll also get an “I &amp;lt;3 Mark&quot; tattoo or something.&lt;/p&gt;&lt;p&gt;Alternatively, I&apos;ll buy you a beer if I ever get the chance. Long story short: you really helped me out, thanks!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4538&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Armand&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-07-25T14:33:03+01:00&quot;&gt;25 July 2013 at 2:33 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;You rock, after all that it works !&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4551&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Mathieu&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-11-14T13:39:25+00:00&quot;&gt;14 November 2013 at 1:39 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thank you Mark! It works perfectly!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4554&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Daniel&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-12-11T16:19:50+00:00&quot;&gt;11 December 2013 at 4:19 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thanks, Mark!&lt;/p&gt;&lt;p&gt;I did need to add another package in order for add-apt-repository to work:&lt;br&gt; sudo apt-get install python-software-properties&lt;/p&gt;&lt;p&gt;After that your patch installed and worked beautifully!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4559&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Markus&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-02-13T16:48:56+00:00&quot;&gt;13 February 2014 at 4:48 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thank You,&lt;/p&gt;&lt;p&gt;it worked for me after installing add-apt-repository (part of python-software-properties, as Daniel mentioned)&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-7331&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Fruitloop&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-09-02T13:21:37+01:00&quot;&gt;2 September 2014 at 1:21 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thanks Mark!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-4059&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Jose Carlos&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-10-23T20:13:34+01:00&quot;&gt;23 October 2012 at 8:13 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Mark,&lt;/p&gt;&lt;p&gt;Many many thanks. You saved my life.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4063&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Peter&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-10-26T20:20:45+01:00&quot;&gt;26 October 2012 at 8:20 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Mark, your solution seems good to me.&lt;/p&gt;&lt;p&gt;I have vsftpd already installed with all the configuration files set up for virtual users. Can you advise as to whether doing another install would lose all my settings.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4064&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Mark&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-10-27T02:08:37+01:00&quot;&gt;27 October 2012 at 2:08 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;I don’t know for sure as I’ve only done fresh installs with it. It’s the same as the regular Ubuntu package though, so it should ask you if you want to replace your config files during the update. If you’re unsure, you can always copy them somewhere before you update.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4065&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Peter&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-10-27T09:35:18+01:00&quot;&gt;27 October 2012 at 9:35 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Mark, that works great. Many thanks.&lt;/p&gt;&lt;p&gt;The config files were left intact, and when I looked at it properly again there was only 2.&lt;/p&gt;&lt;p&gt;I am using this on my own little web server, but is is set up the same as the one I did at work before retirement. I have always had the ftp user going to the root of his account, as that is where I point Apache to. I am afraid that I cannot quite see the logic in the change that was made to vsftpd. Perhaps I have been doing it wrong for years.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4080&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Hacko&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2012-11-21T20:09:05+00:00&quot;&gt;21 November 2012 at 8:09 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Mark, You sir, deserve an internet.&lt;/p&gt;&lt;p&gt;Thanks a bunch.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4086&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Alex&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-01-04T08:30:33+00:00&quot;&gt;4 January 2013 at 8:30 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Mark, you saved our lives!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4384&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;dima&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-02-03T13:48:36+00:00&quot;&gt;3 February 2013 at 1:48 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;# /usr/local/etc/rc.d/vsftpd restart&lt;br&gt; vsftpd not running?&lt;br&gt; Starting vsftpd.&lt;br&gt; 500 OOPS: unrecognised variable in config file: allow_writable_chroot&lt;br&gt; /usr/local/etc/rc.d/vsftpd: WARNING: failed to start vsftpd&lt;/p&gt;&lt;p&gt;pkg_info | grep ftp&lt;/p&gt;&lt;p&gt;vsftpd-ext-2.3.5.1_1 A FTP daemon that aims to be “very secure”. Extended build&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-4385&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-02-03T16:01:16+00:00&quot;&gt;3 February 2013 at 4:01 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Have you given allow_writeable_chroot a go?&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li id=&quot;comment-4520&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Michael&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-02-19T16:26:07+00:00&quot;&gt;19 February 2013 at 4:26 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;I could only get round this by upgrading to the latest deb package found here&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://us.archive.ubuntu.com/ubuntu/pool/main/v/vsftpd/&quot; rel=&quot;nofollow ugc&quot;&gt;http://us.archive.ubuntu.com/ubuntu/pool/main/v/vsftpd/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Which supports the allow_writeable_chroot=YES flag&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4523&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Commendatore&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-03-25T11:57:05+00:00&quot;&gt;25 March 2013 at 11:57 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Another solution is disabling SELinux this should work and make vsftpd work as usual, none of the solutions in this page worked for me. I am using a CentOS 6.4.&lt;br&gt; If you know what you are doing by disabling SELinux then there are no worries, this is how:&lt;/p&gt;&lt;p&gt;vim /etc/selinux/config&lt;br&gt; SELINUX=disabled&lt;br&gt; SETLOCALDEFS=0&lt;/p&gt;&lt;p&gt;SELinux turned off for current session&lt;br&gt; setenforce 0&lt;/p&gt;&lt;p&gt;Hope this helps someone. Regards.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4524&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Oliver&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-03-27T03:51:11+00:00&quot;&gt;27 March 2013 at 3:51 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Mark, you saved my morning! Thanks!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4526&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Fallen Angel&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-05-08T09:44:56+01:00&quot;&gt;8 May 2013 at 9:44 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;This whole article + all comments saved not only my morning, but the whole day!&lt;br&gt; &amp;gt;subscribed&amp;lt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4529&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;csensix&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-05-16T06:52:51+01:00&quot;&gt;16 May 2013 at 6:52 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Great. I just did as you’ve said, changed the authority mode, and, and it works. Thank you.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4541&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Joe&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-08-07T15:07:44+01:00&quot;&gt;7 August 2013 at 3:07 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Much to our dismay, we recently had to update our Ubuntu server packages. VSFTP is one that got updated. Right now VSFTPD is version 2.3.5-1ubuntu2&lt;/p&gt;&lt;p&gt;I believe that in order to get the 3.x versions we would need to upgrade the server again to the dist release. Which I would definitely like to avoid since this is a production server getting used 24/7.&lt;/p&gt;&lt;p&gt;So my question: Does anyone know if it is even possible to get VSFTPD version 2.3.5-1ubuntu2?&lt;/p&gt;&lt;p&gt;Our users have to be able to upload files, obviously, so this isn’t just an FTP setup for downloading only.&lt;/p&gt;&lt;p&gt;Some of the fixes mentioned in this post cause the error message to switch to “ECONNREFUSED – Connection refused by server”. The others do not get around the “500 OOPS: vsftpd: refusing to run with writable root inside chroot()”.&lt;/p&gt;&lt;p&gt;Are we pretty much just screwed if we are stuck with version 2.3.5-1ubuntu2? This is the fourth day I’ve spent working on it and I need to just move on to another FTPD if VSFTD is not supported on this version of Ubuntu server.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4542&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Joe&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-08-07T15:16:25+01:00&quot;&gt;7 August 2013 at 3:16 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Upgrading VSFTPD actually worked fine on the Ubuntu dist. Thanks for the help!&lt;/p&gt;&lt;p&gt;The fix was just to install this version:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://http.us.debian.org/debian/pool/main/v/vsftpd/vsftpd_3.0.2-3_amd64.deb&quot; rel=&quot;nofollow ugc&quot;&gt;http://http.us.debian.org/debian/pool/main/v/vsftpd/vsftpd_3.0.2-3_amd64.deb&lt;/a&gt; -O vsftpd.deb&lt;/p&gt;&lt;p&gt;After upgrading, the fixes listed on this page worked fine.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4545&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Nick&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-08-30T19:30:00+01:00&quot;&gt;30 August 2013 at 7:30 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Mark – you are the man!!!!!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4546&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Matthew&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-09-02T08:43:31+01:00&quot;&gt;2 September 2013 at 8:43 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Working for me on Debian 7 64-bit&lt;/p&gt;&lt;p&gt;wget &lt;a href=&quot;http://ftp.debian.org/debian/pool/main/v/vsftpd/vsftpd_3.0.2-3_amd64.deb&quot; rel=&quot;nofollow ugc&quot;&gt;http://ftp.debian.org/debian/pool/main/v/vsftpd/vsftpd_3.0.2-3_amd64.deb&lt;/a&gt;&lt;br&gt; dpkg -i vsftpd_3.0.2-3_amd64.deb&lt;/p&gt;&lt;p&gt;Then add allow_writeable_chroot=YES to conf&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4550&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;joel&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-11-07T19:32:19+00:00&quot;&gt;7 November 2013 at 7:32 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;thanks Mark!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4553&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Terry Ayala&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-11-27T03:30:45+00:00&quot;&gt;27 November 2013 at 3:30 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Hi all, I have installed vsftpd on ubuntu server 13.10 program which I downloaded&lt;br&gt;&lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/vsftpd/+bug/1160372/+attachment/3661388/+files/vsftpd_3.0.2-1ubuntu1_amd64_patched.deb&quot; rel=&quot;nofollow ugc&quot;&gt;https://bugs.launchpad.net/ubuntu/+source/vsftpd/+bug/1160372/+attachment/3661388/+files/vsftpd_3.0.2-1ubuntu1_amd64_patched.deb&lt;/a&gt;&lt;br&gt; already that next to install by default ubuntu has a bug to log in if I’m not mistaken the 530 error, well the problem I have is that the vsftpd does not allow internal users to write to its roots by a problem of possible vulnerabilities in glibc, the matter is I a program that requires power to write to the root of the ftp user have installed are a novice in matters of linux and I have read many post to make it work walking to adding a folder under the root where if I can upload and download files as well delete them, but they sell the software I need rights to read and write in the root.&lt;/p&gt;&lt;p&gt;I tried the option of Marcos but as I mentioned I am newbie in these things and it does not work, if someone could help giving me a step by step guide I’m going to thank me much.&lt;/p&gt;&lt;p&gt;vsftpd install the program with the following link&lt;br&gt;&lt;a href=&quot;http://www.mclarenx.com/2012/08/10/configurar-vsftpd-y-evitar-los-errores-500-y-530/&quot; rel=&quot;nofollow ugc&quot;&gt;http://www.mclarenx.com/2012/08/10/configurar-vsftpd-y-evitar-los-errores-500-y-530/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;regards&lt;/p&gt;&lt;p&gt;Terry&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4555&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Mitsch&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-12-16T15:16:09+00:00&quot;&gt;16 December 2013 at 3:16 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;thank you Mark, using your build of vsftpd is still the best solution for 12.04 LTS&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4556&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Sandeep&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2013-12-22T16:35:46+00:00&quot;&gt;22 December 2013 at 4:35 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Yes.&lt;/p&gt;&lt;p&gt;After a year, still the solution is to use marks repository and add&lt;br&gt; use&lt;br&gt; allow_writeable_chroot=YES&lt;/p&gt;&lt;p&gt;Thank you so much Mark&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-4562&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Zgordan_VV&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-03-24T07:45:06+00:00&quot;&gt;24 March 2014 at 7:45 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thank you, Dmitriy (January 13, 2012 at 12:51 pm) and the author of the topic, the 1st method is working!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-5497&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Elorius&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-05-29T10:40:20+01:00&quot;&gt;29 May 2014 at 10:40 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Repost: How to get vsftpd running&lt;/p&gt;&lt;p&gt;For those of you running Ubuntu 12.04, I have created a vsftpd 2.3.5 PPA that backports the allow_writeable_chroot config option from vsftpd 3 to the existing Ubuntu package. To use it:&lt;/p&gt;&lt;p&gt; sudo add-apt-repository ppa:thefrontiergroup/vsftpd&lt;br&gt; sudo apt-get update&lt;br&gt; sudo apt-get install vsftpd&lt;/p&gt;&lt;p&gt;allow_writeable_chroot=YES&lt;/p&gt;&lt;p&gt;—&lt;/p&gt;&lt;p&gt;Cheers Mark!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-5886&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Custom&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-06-20T10:00:54+01:00&quot;&gt;20 June 2014 at 10:00 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;try –&lt;/p&gt;&lt;p&gt;setsebool -P allow_ftpd_full_access 0&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-5996&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;HikingMike&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-06-27T16:50:05+01:00&quot;&gt;27 June 2014 at 4:50 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Geez as if configuration wasn’t enough of a pain. Any suggestions on best practice for FTP for the www directory? I set up home directory of a user to /var/www to enable web site FTP access thru that user. Of course that’s when I came across this issue. The config file change worked for me. Thanks! I just wonder if there is a better way because this has to be a common issue.&lt;/p&gt;&lt;p&gt;Wow I see this is pretty old now. Hmmm&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-6280&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;John Nisbet&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-07-18T18:37:42+01:00&quot;&gt;18 July 2014 at 6:37 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;To access a website’s files via vsftp, I configure apache2 to point to a directory in a user’s home (eg. /home/someguy/public). This way the user owns the files, they’re stored with his files, and no one’s poking around outside the home directory. You do this by editing the config files in /etc/apache2/sites-available.&lt;/p&gt;&lt;p&gt;Another way to do it might be to create a symlink inside a user’s home directory that points to the /var/www folder.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-6599&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;quimkaos&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-08-06T00:32:56+01:00&quot;&gt;6 August 2014 at 12:32 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;this is not a bug&lt;br&gt; this is not a problem&lt;br&gt; this is just:&lt;br&gt; it’s preferable to have access system wide then having users jailed to them folders… i want jaill not chroot…&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-6860&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;DJaqua&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-08-14T16:47:33+01:00&quot;&gt;14 August 2014 at 4:47 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Add me to the list of people thankful for the Frontiergroup’s branch. I’m really disappointed that VSFTPD is not as easy to use as it could be. I agree that the security issue that needs to be addressed is glibc, but if that issue off limits to the VSFTPD developers, then it makes sense for the security-conscious FTP daemon to play it extra cautious. Pain in the ass, just the same, though. Perhaps the minor version should have only enabled the “breaking” behaviour if the insecure version of glibc was present on the machine.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-8476&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;mustafa12131&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-10-07T04:11:20+01:00&quot;&gt;7 October 2014 at 4:11 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Man, I lov ya!!!! Thanks!!! :)&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-11970&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;ncist2011&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2014-11-04T03:33:40+00:00&quot;&gt;4 November 2014 at 3:33 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;hi,&lt;br&gt; i added the following command :&lt;br&gt; allow_writeable_chroot=YES&lt;br&gt; it still wrong for anonymous user&lt;/p&gt;&lt;p&gt;i need the root directory writeable for anonymous user ,how should i do ? thank you&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-24916&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Yoshi&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2015-01-19T21:19:53+00:00&quot;&gt;19 January 2015 at 9:19 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thanks for this post Ben. You saved me, and probably a whole lot of other folks, a bunch of time. It is ridiculous how much vsftp has to be fiddled with. it’s definitely not worth installing on a development machine because it is so unnecessarily “secure.” It’s so secure it’s unusable out of the box!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-25910&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;HarryKalahan&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2015-02-02T18:34:08+00:00&quot;&gt;2 February 2015 at 6:34 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Dimitry’s option 2 works fine!&lt;/p&gt;&lt;p&gt;2. Define option passwd_chroot_enable=yes in configuration file and change in /etc/passwd file user home directory from «/home/user» to «/home/./user» (w/o quotes).&lt;br&gt; In this way vsftpd chrooting to /home directory.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-27186&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Brian Lee&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2015-02-24T08:41:38+00:00&quot;&gt;24 February 2015 at 8:41 AM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Thanks! It has worked out perfectly for me!&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;li id=&quot;comment-28394&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;ace&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2015-03-14T12:46:24+00:00&quot;&gt;14 March 2015 at 12:46 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;Did you mean&lt;br&gt; chmod a-w /home/$USER&lt;/p&gt;&lt;/div&gt;&lt;ol&gt;&lt;li id=&quot;comment-28572&quot;&gt;&lt;p class=&quot;comment-header&quot;&gt;&lt;strong&gt;Ben&lt;span class=&quot;comment-author-badge&quot; title=&quot;Post author&quot;&gt; Author &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;time datetime=&quot;2015-03-17T17:20:32+00:00&quot;&gt;17 March 2015 at 5:20 PM&lt;/time&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;comment-content&quot;&gt;&lt;p&gt;I didn’t mean to write it like that, but if you’re currently logged in as that user then your solution is better if it works.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;</content:encoded></item></channel></rss>