<?xml version="1.0" encoding="utf-8" standalone="yes"?><feed xmlns="http://www.w3.org/2005/Atom">
  <title></title>
  <subtitle></subtitle>
  <id>https://www.endpointdev.com/blog/tags/debian/</id>
  <link href="https://www.endpointdev.com/blog/tags/debian/"/>
  <link href="https://www.endpointdev.com/blog/tags/debian/" rel="self"/>
  <updated>2015-03-11T00:00:00+00:00</updated>
  <author>
    <name>End Point Dev</name>
  </author>
  
    <entry>
      <title>Cross Release APT Managment aka How to Watch Netflix on Debian 7 Wheezy</title>
      <link rel="alternate" href="https://www.endpointdev.com/blog/2015/03/cross-release-apt-managment-aka-how-to/"/>
      <id>https://www.endpointdev.com/blog/2015/03/cross-release-apt-managment-aka-how-to/</id>
      <published>2015-03-11T00:00:00+00:00</published>
      <author>
        <name>Bryan Berry</name>
      </author>
      <content type="html">
        &lt;p&gt;Native Netflix video streaming has come to GnuLinux! &amp;hellip;if you have the correct library versions.&lt;/p&gt;
&lt;p&gt;I am currently running GNU-Linux Debian 7 Wheezy with OpenBox.  I really enjoy this lightweight, speedy and easily customized window manager (OpenBox uses simple XML configuration files). So I was also pretty excited when Netflix added HTML5 streaming support and read that folks were proclaiming success in Google Chrome browsers without necessitating any agent masking workarounds.&lt;/p&gt;
&lt;p&gt;However, I found I was still getting errors when attempting to stream video in Chrome. The forums I was reading were reporting that when using the Chrome 36+ browser, Netflix would allow Linux streaming. Most all of these forums were based in a Ubuntu 14.04+ environment. Nevertheless, I found a hint as to how to proceed in Debian after reading &lt;a href=&#34;http://www.pcworld.com/article/2824623/ubuntu-linux-gets-netflix-without-weird-workarounds.html&#34;&gt;this&lt;/a&gt; article regarding libnss:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Netflix streams its video in HTML5, but uses a technology called Encrypted Media Extensions to prevent piracy. These extensions in turn require a set of libraries called Network Security Services that the browser can access.”&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Debian Wheezy’s repo list maxed out at libnss3==2:3.14 and I would need libnss3==2:3.16+ in order to pass the DRM tests and securely stream with Netflix’s HTML5 option enabled. In order to allow this libnss upgrade, I would first need to provide APT with instructions to pull from the Debian “jessie” development branch.&lt;/p&gt;
&lt;p&gt;This is accomplished by setting repo priorities. I created a “jessie” specific APT sources list and added the Debian repo url’s for jessie:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-plain&#34; data-lang=&#34;plain&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ cat /etc/apt/sources.list.d/jessie.list
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;## DEBIAN JESSIE
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;deb ftp://ftp.debian.org/debian/ jessie main
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;deb-src ftp://ftp.debian.org/debian/ jessie main&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And set pin priorities for libnss3 to fetch jessie libraries over wheezy while defining a lower priority of all other jessie packages:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-plain&#34; data-lang=&#34;plain&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ cat /etc/apt/preferences
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Package: *
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Pin: release a=waldorf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Pin-Priority: 1001
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Package: *
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Pin: release a=wheezy
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Pin-Priority: 500
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Package: *
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Pin: release a=jessie
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Pin-Priority: 110
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Package: libnss3
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Pin: release n=jessie
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Pin-Priority: 510&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now, update apt and confirm higher libnss3 installation candidates:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-plain&#34; data-lang=&#34;plain&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ sudo apt-get update &amp;amp;&amp;amp; sudo apt-cache policy libnss3
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;libnss3:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Installed: 2:3.14.5-1+deb7u3
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Candidate: 2:3.17.2-1.1
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Package pin: 2:3.17.2-1.1
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Version table:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    2:3.17.2-1.1 510
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        500 ftp://ftp.debian.org/debian/ jessie/main amd64 Packages
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;*** 2:3.14.5-1+deb7u3 510
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        500 http://http.debian.net/debian/ wheezy/main amd64 Packages
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        500 http://security.debian.org/ wheezy/updates/main amd64 Packages
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        100 /var/lib/dpkg/status&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Install new libnss3 candidate:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-plain&#34; data-lang=&#34;plain&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ sudo apt-get install libnss3=2:3.17.2-1.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Restart any Chrome instances (and upgrade to 36+ if you haven’t yet) and enjoy Netflix streaming on Debian Linux!&lt;/p&gt;

      </content>
    </entry>
  
    <entry>
      <title>Use Ansible/Jinja2 templates to change file content based on target OS</title>
      <link rel="alternate" href="https://www.endpointdev.com/blog/2013/12/use-ansiblejinja2-templates-to-change/"/>
      <id>https://www.endpointdev.com/blog/2013/12/use-ansiblejinja2-templates-to-change/</id>
      <published>2013-12-19T00:00:00+00:00</published>
      <author>
        <name>Emanuele “Lele” Calò</name>
      </author>
      <content type="html">
        &lt;p&gt;In the End Point hosting team we really love automating repetitive tasks, especially when it involves remembering many little details which can over time be forgotten, like differences of &lt;em&gt;coreutils&lt;/em&gt; location between some versions of Ubuntu (Debian), CentOS (Red Hat) and OpenBSD variants.&lt;/p&gt;
&lt;p&gt;In our environment we bind the backup SSH user authorized_keys entry to a custom command in order to have it secured by being, among other aspects, tied to a specific rsync call.&lt;/p&gt;
&lt;p&gt;So in our case the content of our &lt;strong&gt;CentOS&lt;/strong&gt; authorized_keys would be something like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#369&#34;&gt;command&lt;/span&gt;=&lt;span style=&#34;color:#d20;background-color:#fff0f0&#34;&gt;&amp;#34;/bin/nice -15 /usr/bin/rsync --server --daemon .&amp;#34;&lt;/span&gt;,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAB3[...]&lt;span style=&#34;color:#369&#34;&gt;Q&lt;/span&gt;== endpoint-backup&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Sadly that’s only true for CentOS systems so that if you want to &lt;strong&gt;automate the distribution of authorized_keys&lt;/strong&gt; (as we’ll show in another post) to different Linux distributions (like &lt;strong&gt;Ubuntu&lt;/strong&gt;) you may need to tweak it to comply to the new standard “/usr/bin” location, which will be eventually adopted by all new Linux versions overtime.. RHEL 7.x onward included.&lt;/p&gt;
&lt;p&gt;To do the OS version detection we decided to use an &lt;strong&gt;Ansible&lt;/strong&gt;/&lt;strong&gt;Jinja2&lt;/strong&gt; template by placing the following line in the Ansible task:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- name: Deploy /root/.ssh/authorized_keys
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  template: &lt;span style=&#34;color:#369&#34;&gt;src&lt;/span&gt;=all/root/.ssh/authorized_keys.j2
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#369&#34;&gt;dest&lt;/span&gt;=/root/.ssh/authorized_keys
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#369&#34;&gt;owner&lt;/span&gt;=root
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#369&#34;&gt;group&lt;/span&gt;=root
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#369&#34;&gt;mode&lt;/span&gt;=&lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;0600&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And inside the actual file place a slightly modified version of the line above:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#369&#34;&gt;command&lt;/span&gt;=&lt;span style=&#34;color:#d20;background-color:#fff0f0&#34;&gt;&amp;#34;{% if ansible_os_family != &amp;#34;&lt;/span&gt;RedHat&lt;span style=&#34;color:#d20;background-color:#fff0f0&#34;&gt;&amp;#34; %}/usr{% endif %}/bin/nice -15 /usr/bin/rsync --server --daemon .&amp;#34;&lt;/span&gt;,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAB3[...]&lt;span style=&#34;color:#369&#34;&gt;Q&lt;/span&gt;== endpoint-backup&lt;span style=&#34;color:#d20;background-color:#fff0f0&#34;&gt;&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So that if the target OS is not part of the “RedHat” family it will add the “/usr” in front of the “/bin/nice” absolute path.&lt;/p&gt;
&lt;p&gt;Easy peasy, ain’t it?&lt;/p&gt;
&lt;p&gt;Now go out there and exploit this feature to all your needs.&lt;/p&gt;

      </content>
    </entry>
  
    <entry>
      <title>PostgreSQL Debian apt repository GnuPG key update</title>
      <link rel="alternate" href="https://www.endpointdev.com/blog/2013/10/postgresql-debian-apt-repository-gnupg/"/>
      <id>https://www.endpointdev.com/blog/2013/10/postgresql-debian-apt-repository-gnupg/</id>
      <published>2013-10-15T00:00:00+00:00</published>
      <author>
        <name>Jon Jensen</name>
      </author>
      <content type="html">
        &lt;p&gt;The excellent PGDG (PostgreSQL Global Development Group) apt repositories provide current point releases of supported PostgreSQL versions for Debian and Ubuntu LTS Linux. If you’d like to use a newer version of PostgreSQL than ships with your Linux distribution, or need to use an older Postgres release, you should take a look at &lt;a href=&#34;http://wiki.postgresql.org/wiki/Apt&#34;&gt;http://wiki.postgresql.org/wiki/Apt&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A minor housekeeping matter arose just a few days ago: The GnuPG key used to sign the PostgreSQL packages expired on October 13. During a run of apt-get update &amp;amp;&amp;amp; apt-get upgrade that leads to errors such as those seen here:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:1 http://security.debian.org wheezy/updates Release.gpg [836 B]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:2 http://security.debian.org wheezy/updates Release [102 kB]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:3 http://apt.postgresql.org wheezy-pgdg Release.gpg [836 B]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:4 http://ftp.de.debian.org wheezy Release.gpg [1,672 B]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:5 http://apt.postgresql.org wheezy-pgdg Release [29.2 kB]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:6 http://ftp.de.debian.org wheezy-updates Release.gpg [836 B]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:7 http://ftp.de.debian.org wheezy Release [168 kB]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Err http://apt.postgresql.org wheezy-pgdg Release
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:8 http://security.debian.org wheezy/updates/main Sources [61.2 kB]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:9 http://security.debian.org wheezy/updates/main amd64 Packages [113 kB]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:10 http://security.debian.org wheezy/updates/main Translation-en [66.5 kB]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:11 http://ftp.de.debian.org wheezy-updates Release [124 kB]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:12 http://ftp.de.debian.org wheezy/main Sources [5,959 kB]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:13 http://ftp.de.debian.org wheezy/main amd64 Packages [5,848 kB]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:14 http://ftp.de.debian.org wheezy/main Translation-en [3,851 kB]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Get:15 http://ftp.de.debian.org wheezy-updates/main Sources [1,995 B]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Hit http://ftp.de.debian.org wheezy-updates/main amd64 Packages/DiffIndex
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Hit http://ftp.de.debian.org wheezy-updates/main Translation-en/DiffIndex
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Fetched 16.3 MB in 5s (3,094 kB/s)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Reading package lists... Done
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;http://apt.postgresql.org wheezy-pgdg Release: The following signatures were invalid: KEYEXPIRED 1381654177
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;W: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/wheezy-pgdg/Release
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;W: Some index files failed to download. They have been ignored, or old ones used instead.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And, fair enough, the &lt;a href=&#34;http://wiki.postgresql.org/wiki/Apt&#34;&gt;PostgreSQL apt wiki page&lt;/a&gt; mentions this in its news section:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;2013-10-10: New pgdg-keyring version extending the key expiration date. The old expiration date is 2013-10-13.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Updating the key to quell the error may not be quite as simple as expected, though. If you follow the instructions on the page, you would do this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Indeed that imports the new key. However, you may still see errors from apt. Why? It’s possible to have apt trusted keys installed in more than one place:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;# apt-key list
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/etc/apt/trusted.gpg
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;--------------------
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pub   4096R/ACCC4CF8 2011-10-13 [expires: 2016-02-24]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;uid                  PostgreSQL Debian Repository
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/etc/apt/trusted.gpg.d//apt.postgresql.org.gpg
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;----------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pub   4096R/ACCC4CF8 2011-10-13 [expired: 2013-10-13]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;uid                  PostgreSQL Debian Repository&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;A script is referenced from the apt setup page but it doesn’t do the exact same thing as the instructions show. Instead, it installs the GPG key in /etc/apt/sources.list.d/pgdg.list, and unless we update or remove that file, apt will continue to see the expired key and complain about it.&lt;/p&gt;
&lt;p&gt;In our example above, we have already imported the new key into the main /etc/apt/trusted.gpg keystore, so let’s just remove the original key that was in its own file in /etc/apt/trusted.gpg.d/ like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;rm -f /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Afterward, apt happily proceeds with its work.&lt;/p&gt;

      </content>
    </entry>
  
    <entry>
      <title>Proxmox and the fun maze of IPv6 connectivity</title>
      <link rel="alternate" href="https://www.endpointdev.com/blog/2013/07/proxmox-and-fun-maze-of-ipv6/"/>
      <id>https://www.endpointdev.com/blog/2013/07/proxmox-and-fun-maze-of-ipv6/</id>
      <published>2013-07-08T00:00:00+00:00</published>
      <author>
        <name>Emanuele “Lele” Calò</name>
      </author>
      <content type="html">
        &lt;p&gt;While working on the Proxmox machine setup and specifically on the IPv6 connectivity I found a problem where after a reboot I always kept getting the *** net.ipv6.conf.all.forwarding*** and all related variable set to &lt;em&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/em&gt;, thus giving lots of IPv6 network connectivity issues on the guests.&lt;/p&gt;
&lt;p&gt;While brainstorming with a colleague on this, we discovered in the boot logs these few messages which are quite indicative of something horrible happening at boot:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;# less /var/log/boot.0
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;[..]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: Setting kernel variables ...sysctl: cannot stat /proc/sys/net/ipv6/conf/all/forwarding: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/default/forwarding: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/default/autoconf: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/default/accept_dad: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/default/accept_ra: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/default/accept_ra_defrtr: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/default/accept_ra_rtr_pref: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/default/accept_ra_pinfo: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/default/accept_source_route: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/default/accept_redirects: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/all/autoconf: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/all/accept_dad: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/all/accept_ra: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/all/accept_ra_defrtr: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/all/accept_ra_rtr_pref: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/all/accept_ra_pinfo: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/all/accept_source_route: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: sysctl: cannot stat /proc/sys/net/ipv6/conf/all/accept_redirects: No such file or directory
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Mon Jul  8 18:38:59 2013: done.
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;[..]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The following steps would be to either crawl through the “inextricable” maze of the ProxMox (PVE) boot initrd image and probably came up with the solution or find a quick way to deal with this in a clean way without touching the boot process.&lt;/p&gt;
&lt;p&gt;Since it was all due to &lt;em&gt;&lt;strong&gt;sysctl&lt;/strong&gt;&lt;/em&gt; being called too early in the boot process and then not finding proper IPv6 module already loaded calling it again &lt;em&gt;later&lt;/em&gt; would suffice. So I simply added the following line to &lt;em&gt;&lt;strong&gt;/etc/network/interfaces&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;iface eth0 inet6 static
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;address    YOUR:IPV6:IS:HERE
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;netmask    64
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;up ip -6 route add default via fe80::1 dev eth0
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;up sysctl -p # &amp;lt;------ ADDED THIS LINE TO FIX IPv6 CONNECTIVITY ISSUES&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And there it goes. Reboot once again to verify and you should be all set.&lt;/p&gt;

      </content>
    </entry>
  
    <entry>
      <title>IPv6 Tunnels with Debian/Ubuntu behind NAT</title>
      <link rel="alternate" href="https://www.endpointdev.com/blog/2012/03/ipv6-tunnels-with-debianubuntu-behind/"/>
      <id>https://www.endpointdev.com/blog/2012/03/ipv6-tunnels-with-debianubuntu-behind/</id>
      <published>2012-03-01T00:00:00+00:00</published>
      <author>
        <name>Brian Buchalter</name>
      </author>
      <content type="html">
        &lt;p&gt;As part of End Point’s preparation for &lt;a href=&#34;/blog/2012/02/world-ipv6-launch-6-june-2012/&#34;&gt;World IPv6 Launch Day&lt;/a&gt;, I was asked to get my &lt;a href=&#34;http://ipv6.he.net/certification/&#34;&gt;IPv6 certification&lt;/a&gt; from Hurricane Electric.  It’s a fun little game-based learning program which had me setup a IPv6 tunnel.  IPv6 tunnels are used to provide IPv6 for those whose folks whose ISP or hosting provider don’t currently support IPv6, by &amp;ldquo;tunneling&amp;rdquo; it over IPv4.  The process for &lt;a href=&#34;http://tunnelbroker.net/login.php?redir=%2Fnew_tunnel.php&#34;&gt;creating a tunnel&lt;/a&gt; is straight forward enough, but there were a few configuration steps I felt could be better explained.&lt;/p&gt;
&lt;p&gt;After creating a tunnel, Hurricane Electric kindly provides a summary of your configuration and offers example configurations for several different operating systems and routers.  Below is my configuration summary and the example generated by Hurricane Electric.&lt;/p&gt;
&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;/blog/2012/03/ipv6-tunnels-with-debianubuntu-behind/image-0-big.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left:1em; margin-right:1em&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;176&#34; src=&#34;/blog/2012/03/ipv6-tunnels-with-debianubuntu-behind/image-0.png&#34; width=&#34;400&#34;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;/blog/2012/03/ipv6-tunnels-with-debianubuntu-behind/image-1-big.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left:1em; margin-right:1em&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;174&#34; src=&#34;/blog/2012/03/ipv6-tunnels-with-debianubuntu-behind/image-1.png&#34; width=&#34;400&#34;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;However, entering these commands change won’t survive a restart.  For Debian/Ubuntu users an update in /etc/network/interfaces does the trick.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;#/etc/network/interfaces&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;auto he-ipv6
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;iface he-ipv6 inet6 v4tunnel
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  address 2001:470:4:9ae::2
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  netmask &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;64&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  endpoint 209.51.161.58
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#038&#34;&gt;local&lt;/span&gt; 204.8.67.188
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ttl &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;225&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  gateway 2001:470:4:9ae::1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&#34;firewall-configuration&#34;&gt;Firewall Configuration&lt;/h3&gt;
&lt;p&gt;If you’re running UFW the updates to /etc/default/ufw are very straightforward.  Simply change the IPV6 directive to yes.  Restart the firewall and your network interfaces and you should be able to ping6 ipv6.google.com.  I also recommend hitting &lt;a href=&#34;http://test-ipv6.com&#34;&gt;http://test-ipv6.com/&lt;/a&gt; for a detailed configuration test.&lt;/p&gt;
&lt;h3 id=&#34;behind-nat&#34;&gt;Behind NAT&lt;/h3&gt;
&lt;p&gt;If you’re behind a NAT, the configuration needs to be tweaked a bit.  First, you’ll want to setup a static IP address behind your router.  If you’re router supports configuration of forwarding more than just TCP/UDP, you’ll want to forward protocol 41 (aka IPv6) (&lt;strong&gt;NOT PORT 41&lt;/strong&gt;), which is responsible for IPv6 tunneling over IPv4, to your static address.  If you’ve got a consumer grade router that doesn’t support this, you’ll just have to put your machine in the DMZ, thus putting your computer &amp;ldquo;in front&amp;rdquo; of your router’s firewall.  Please make sure you are running a local software firewall if you chose this option.&lt;/p&gt;
&lt;p&gt;After handling the routing of protocol 41, there is one small configuration change to /etc/network/interfaces.  You must change your tunnel’s local address from your public IP address, to your private NATed address.  Here is an example configuration including both the static IP configuration and the updated tunnel configuration.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;#/etc/network/interfaces&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;auto eth0
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;iface eth0 inet static
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  address 192.168.0.50
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  netmask 255.255.255.0
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  gateway 192.168.0.1 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;auto he-ipv6
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;iface he-ipv6 inet6 v4tunnel
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  address 2001:470:4:9ae::2
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  netmask &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;64&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  endpoint 209.51.161.58
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &amp;lt;b&amp;gt;local 192.168.0.50&amp;lt;/b&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ttl &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;225&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  gateway 2001:470:4:9ae::1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Don’t forget to restart your networking interfaces after these changes.  I found a good ol’ restart was helpful as well, but of course, we don’t have this luxury in production, so be careful!&lt;/p&gt;
&lt;h3 id=&#34;checking-ipv6&#34;&gt;Checking IPv6&lt;/h3&gt;
&lt;p&gt;If you’re reading this article, you’re probably responsible for several hosts.  For a gentle reminder which of your sites you’ve not yet setup IPv6, I recommend checking out &lt;a href=&#34;http://code.google.com/p/ipvfoo/&#34;&gt;IPvFoo for Chrome&lt;/a&gt; or &lt;a href=&#34;https://addons.mozilla.org/en-US/firefox/addon/4or6/?src=search&#34;&gt;4or6 for Firefox&lt;/a&gt;.  These tools make it easy for you to see which of your sites are ready for World IPv6 Launch Day!&lt;/p&gt;
&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://ipvfoo.googlecode.com/svn/misc/screenshot_webstore_640x400.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left:1em; margin-right:1em&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;400&#34; src=&#34;http://ipvfoo.googlecode.com/svn/misc/screenshot_webstore_640x400.png&#34; width=&#34;640&#34;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h3 id=&#34;getting-help&#34;&gt;Getting Help&lt;/h3&gt;
&lt;p&gt;Hurricane Electric provides really great support for their IPv6 tunnel services (which is completely free).  Simply email &lt;a href=&#34;mailto:ipv6@he.net&#34;&gt;ipv6@he.net&lt;/a&gt; and provide them with some useful information such as:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cat /etc/network/interfaces
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cat netstat -nrA inet6  (these are your IPv6 routing tables)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cat /etc/default/ufw
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;relevant router configurations&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I was very impressed to get a response from a competent person in &lt;strong&gt;15 minutes&lt;/strong&gt;!  Sadly, there is one downside to using this tunnel; IRC is not an allowed.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Due to an increase in IRC abuse, new non-BGP tunnels now have IRC blocked by default.  If you are a Sage, you can re-enable IRC by visiting the tunnel details page for that specific tunnel and selecting the ‘Unblock IRC’ option.  Existing tunnels have not been filtered.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I guess ya gotta earn it to use IRC over your tunnel.  Good luck!&lt;/p&gt;

      </content>
    </entry>
  
    <entry>
      <title>Linux unshare -m for per-process private filesystem mount points</title>
      <link rel="alternate" href="https://www.endpointdev.com/blog/2012/01/linux-unshare-m-for-per-process-private/"/>
      <id>https://www.endpointdev.com/blog/2012/01/linux-unshare-m-for-per-process-private/</id>
      <published>2012-01-27T00:00:00+00:00</published>
      <author>
        <name>Jon Jensen</name>
      </author>
      <content type="html">
        &lt;h3 id=&#34;private-mount-points-with-unshare&#34;&gt;Private mount points with unshare&lt;/h3&gt;
&lt;p&gt;Linux offers some pretty interesting features that are either new, borrowed, obscure, experimental, or any combination of those qualities. One such feature that is interesting is the &lt;strong&gt;unshare() function&lt;/strong&gt;, which the unshare(2) man page says “allows a process to disassociate parts of its execution context that are currently being shared with other processes. Part of the execution context, such as the mount namespace, is shared implicitly when a new process is created using fork(2) or vfork(2)”.&lt;/p&gt;
&lt;p&gt;I’m going to talk here about one option to unshare: &lt;strong&gt;per-process private filesystem mount points&lt;/strong&gt;, also described as mount namespaces. This Linux kernel feature has been around for a few years and is easily accessible in the userland command unshare(1) in util-linux-ng 2.17 or newer (which is now simply util-linux again without the &amp;ldquo;ng&amp;rdquo; distinction because the fork took over mainline development).&lt;/p&gt;
&lt;p&gt;Running &lt;code&gt;unshare -m&lt;/code&gt; gives the calling process a private copy of its mount namespace, and also unshares file system attributes so that it no longer shares its root directory, current directory, or umask attributes with any other process.&lt;/p&gt;
&lt;p&gt;Yes, completely private mount points for each process. Isn’t that interesting and strange?&lt;/p&gt;
&lt;h3 id=&#34;a-demonstration&#34;&gt;A demonstration&lt;/h3&gt;
&lt;p&gt;Here’s a demonstration on an Ubuntu 11.04 system. In one terminal:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;% su -
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Password:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# unshare -m /bin/bash&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# secret_dir=`mktemp -d --tmpdir=/tmp`&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# echo $secret_dir&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/tmp/tmp.75xu4BfiCw
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# mount -n -o size=1m -t tmpfs tmpfs $secret_dir&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# df -hT&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Filesystem    Type    Size  Used Avail Use% Mounted on
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/dev/mapper/auge-root
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              ext4    451G  355G   74G  83% /&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;There’s no system-wide sign of /tmp/tmp.* there thanks to mount -n which hides it. But it can be seen process-private here:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# grep /tmp /proc/mounts&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;tmpfs /tmp/tmp.75xu4BfiCw tmpfs rw,relatime,size=1024k &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;0&lt;/span&gt; &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# cd $secret_dir&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# ls -lFa&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;total &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;36&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;drwxrwxrwt  &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;2&lt;/span&gt; root root    &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;40&lt;/span&gt; 2011-11-03 22:10 ./
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;drwxrwxrwt &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;21&lt;/span&gt; root root &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;36864&lt;/span&gt; 2011-11-03 22:10 ../
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# touch play-file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# mkdir play-dir&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# ls -lFa&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;total &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;36&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;drwxrwxrwt  &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;3&lt;/span&gt; root root    &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;80&lt;/span&gt; 2011-11-03 22:10 ./
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;drwxrwxrwt &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;21&lt;/span&gt; root root &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;36864&lt;/span&gt; 2011-11-03 22:10 ../
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;drwxr-xr-x  &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;2&lt;/span&gt; root root    &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;40&lt;/span&gt; 2011-11-03 22:10 play-dir/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;-rw-r--r--  &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;1&lt;/span&gt; root root     &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;0&lt;/span&gt; 2011-11-03 22:10 play-file&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Afterward, in another terminal, and thus a separate process with no visibility into the above-shown terminal process’s private mount points:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;% su -
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Password:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# grep /tmp /proc/mounts&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# cd /tmp/tmp.75xu4BfiCw&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#888&#34;&gt;# ls -lFa&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;total &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;40&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;drwx------  &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;2&lt;/span&gt; root root  &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;4096&lt;/span&gt; 2011-11-03 22:10 ./
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;drwxrwxrwt &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;21&lt;/span&gt; root root &lt;span style=&#34;color:#00d;font-weight:bold&#34;&gt;36864&lt;/span&gt; 2011-11-03 22:18 ../&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It’s all secret!&lt;/p&gt;
&lt;h3 id=&#34;use-cases&#34;&gt;Use cases&lt;/h3&gt;
&lt;p&gt;This feature makes it possible for us to create a private temporary filesystem that even other root-owned processes cannot see or browse through, raising the bar considerably for a naive attacker to get access to sensitive files or even see that they exist, at least when they’re not currently open and visible to e.g. lsof.&lt;/p&gt;
&lt;p&gt;Of course a sophisticated attacker would presumably have a tool to troll through kernel memory looking for what they need. As always, assume that a sophisticated attacker who has access to the machine will sooner or later have anything they really want from it. But we’d might as well make it a challenge.&lt;/p&gt;
&lt;p&gt;Another possible use of this feature is to have a process unmount a filesystem privately, perhaps to reduce the exposure of other files on a system to a running daemon if it is compromised.&lt;/p&gt;
&lt;h3 id=&#34;etcmtab-vs-procmounts&#34;&gt;/etc/mtab vs. /proc/mounts&lt;/h3&gt;
&lt;p&gt;Experimenting with this feature also drew my attention to differences in how popular Linux distributions expose mount points. There are actually traditionally two places that the list of mounts is stored on a Linux system.&lt;/p&gt;
&lt;p&gt;First, the classic Unix &lt;strong&gt;/etc/mtab&lt;/strong&gt;, which is in essence a materialized view. It is the reason that on the Ubuntu 11.04 example above we see the private mount point everywhere on the system, but it reported different disk sizes. The existence of the mount point was global in /etc/mtab but the sizes are determined dynamically and differ based on process’s view into the mount points themselves. The &lt;code&gt;mount -n&lt;/code&gt; option tells mount to not put the new mount point into /etc/mtab. And this is what the df(1) command refers to. How repulsive that a file in the normally read-only /etc is written to so nonchalantly!&lt;/p&gt;
&lt;p&gt;Second, the Linux-specific &lt;strong&gt;/proc/mounts&lt;/strong&gt;, which is real-time, exact, and accurate, and can appear differently to each process. The mount invocation can’t hide anything from /proc/mounts. This is what you would think is the only place to look for mounts, but /etc/mtab is still used some places.&lt;/p&gt;
&lt;p&gt;Ubuntu 11.04 still has both, with a separate /etc/mtab. Fedora 16 has done away with /etc/mtab entirely and made it merely a symlink to /proc/mounts, which makes sense, but that is a newer convention and leads to the surprising difference here.&lt;/p&gt;
&lt;h3 id=&#34;linux-distributions-and-unshare&#34;&gt;Linux distributions and unshare&lt;/h3&gt;
&lt;p&gt;The unshare userland command in util-linux(-ng) comes with RHEL 6, Debian 6, Ubuntu 11.04, and Fedora 16, but &lt;em&gt;not&lt;/em&gt; on the very common RHEL 5 or CentOS 5. Because we needed it on RHEL 5, I made a simple package that contains only the unshare(1) command and peacefully coexists with the older stock RHEL 5 util-linux. It’s called util-linux-unshare and here are the RPM downloads for RHEL 5:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;x86_64: &lt;a href=&#34;https://packages.endpointdev.com/rhel/5/os/x86_64/util-linux-unshare-2.20.1-3.ep.x86_64.rpm&#34;&gt;util-linux-unshare-2.20.1-3.ep.x86_64.rpm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;i386: &lt;a href=&#34;https://packages.endpointdev.com/rhel/5/os/i386/util-linux-unshare-2.20.1-3.ep.i386.rpm&#34;&gt;util-linux-unshare-2.20.1-3.ep.i386.rpm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;SRPM: &lt;a href=&#34;https://packages.endpointdev.com/rhel/5/os/SRPMS/util-linux-unshare-2.20.1-3.ep.src.rpm&#34;&gt;util-linux-unshare-2.20.1-3.ep.src.rpm&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I hope you’ve found this as interesting as I did!&lt;/p&gt;
&lt;h3 id=&#34;further-reading&#34;&gt;Further reading&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Karel Zak is the util-linux maintainer and a Red Hat employee; see his &lt;a href=&#34;http://karelzak.blogspot.com/2009/12/unshare1.html&#34;&gt;detailed blog post about the unshare command&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://linux.die.net/man/2/unshare&#34;&gt;unshare(2)&lt;/a&gt; function man page&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://linux.die.net/man/1/unshare&#34;&gt;unshare(1)&lt;/a&gt; userland command man page&lt;/li&gt;
&lt;li&gt;The difference between /etc/mtab and /proc/mounts is described well in &lt;a href=&#34;http://karelzak.blogspot.com/2011/04/bind-mounts-mtab-and-read-only.html&#34;&gt;Karel Zak’s blog post about bind mounts &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Util-linux&#34;&gt;util-linux overview&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

      </content>
    </entry>
  
</feed>
