<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ubuntu.webarch.uk/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chris</id>
	<title>UbuntuPhone - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://ubuntu.webarch.uk/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chris"/>
	<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/wiki/Special:Contributions/Chris"/>
	<updated>2026-04-23T01:01:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=65</id>
		<title>Debian Chroot</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=65"/>
		<updated>2017-11-22T20:34:55Z</updated>

		<summary type="html">&lt;p&gt;Chris: /* 2) Using phone only */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following was written by Torsten Sachse and [https://lists.launchpad.net/ubuntu-phone/msg13344.html posted to the Ubuntu Phone email list on 16 Jun 2015] and reproduction was permitted under the terms of the GPL. There is also [http://askubuntu.com/a/678031 a updated version on Ask Ubuntu], see also [https://askubuntu.com/questions/620740/recommended-way-to-install-regularcli-deb-packages-on-ubuntu-phone/623311 this thread on Ask Ubuntu].&lt;br /&gt;
&lt;br /&gt;
== Debian Chroot ==&lt;br /&gt;
&lt;br /&gt;
This is a simple guide describing how to set up a chroot on a Ubuntu touch device. It also explains how to set it up so that the chroot is located on the SD-card to save internal storage space and goes into some detail about why simply installing the chroot on an SD-card is not possible.&lt;br /&gt;
&lt;br /&gt;
The guide is structured as follows:&lt;br /&gt;
&lt;br /&gt;
# Comments on file systems and permissions&lt;br /&gt;
# Using phone only&lt;br /&gt;
# Using computer and phone (recommended)&lt;br /&gt;
# Unsing an image file (recommended)&lt;br /&gt;
&lt;br /&gt;
== 1) Comments on file systems and permissions ==&lt;br /&gt;
&lt;br /&gt;
Only some file system types support file permissions in a way the chroot needs them. An SD-card likely uses FAT32 which does not support any type of permissions and, hence, the chroot can't run on it.  The permissions reported by commands like &amp;quot;&amp;lt;code&amp;gt;ls -l&amp;lt;/code&amp;gt;&amp;quot; do not have any significance on such file systems. Some Android handsets for instance support EXT3 or ECT4 on their SD-cards making installing a chroot a lot easier.&lt;br /&gt;
&lt;br /&gt;
== 2) Using phone only == &lt;br /&gt;
&lt;br /&gt;
'''(not recommended since it breaks over the air updates)''' &lt;br /&gt;
&lt;br /&gt;
It is possible to install debootstrap on the phone by remounting the system as read-write and executing the following commands. At least it worked on my BQ on r22. Imagine you want to install your chroot into the directory &amp;quot;jessie&amp;quot; which should reside in the current working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mount / -o remount,rw&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install debootstrap&lt;br /&gt;
sudo debootstrap --arch=armhf jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This only works on the internal storage without what's explained in section 4).&lt;br /&gt;
&lt;br /&gt;
Or for stretch:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mount / -o remount,rw&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install debootstrap debian-archive-keyring&lt;br /&gt;
mkdir /home/phablet/debian&lt;br /&gt;
cd /home/phablet&lt;br /&gt;
sudo debootstrap --arch=armhf stretch ./debian https://mirrorservice.org/sites/ftp.debian.org/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3) Using computer and phone ==&lt;br /&gt;
&lt;br /&gt;
The problem with this debootstrap-command failing your average computer is that your computer cannot execute binaries compiled for the ARM architechture. This is why you have to add the option &amp;lt;code&amp;gt;--foreign&amp;lt;/code&amp;gt; to debootstrap which tells it to only download all packages and leave anything that needs executing of any of the installed binaries to another system. So do (sudo might not be needed):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo debootstrap --arch=armhf --foreign jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were to install an i386 architechture on a x86_64 system, you would not have to specify the &amp;lt;code&amp;gt;--foreign&amp;lt;/code&amp;gt; flag as both should be able to run on an ordinary 64-bit processor although they're different architechrures.&lt;br /&gt;
&lt;br /&gt;
Now best create a tar archive from this which you then copy to your phone. It does not matter whether the archive is put on the SD-card or the internal storage. The second command is needed to turn on ssh support, which is reset upon every reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -cvzf jessie.tar.gz jessie&lt;br /&gt;
sudo service ssh start&lt;br /&gt;
scp jessie.tar.gz phablet@ubuntu-phablet:DIRECTORY_OF_YOUR_CHOICE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you only have to extract the archive wherever you want the new directory &amp;quot;jessie&amp;quot; to reside. Without what's expained in section 4), this will only work on your internal storage.  Then, you only have to go into your chroot and finish the installation process. So do on the phone (the first command is needed since the terminal app is somehow restricted to execute binaries):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh localhost&lt;br /&gt;
tar -xvzf jessie.tar.gz&lt;br /&gt;
sudo chroot jessie /bin/bash&lt;br /&gt;
/debootstrap/debootstrap --second-stage&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to chroot into your new system using the third of the above commands.&lt;br /&gt;
&lt;br /&gt;
== 4) Using an image file ==&lt;br /&gt;
&lt;br /&gt;
First, create an image file on the system on which you execute the first debootstrap command. To create an 1GB image, do&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=IMAGE.img bs=1G count=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the B in GB is left out. &amp;quot;if&amp;quot; stands for &amp;quot;input file&amp;quot;, &amp;quot;of&amp;quot; for &amp;quot;output file&amp;quot; and &amp;quot;bs&amp;quot; for &amp;quot;block size&amp;quot;. There are more efficient commands out there, but those only work on certain types of file systems, AFAIK. This one also works on an SD-card or a tempfs. Please note the use of &amp;lt;code&amp;gt;/dev/zero&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;/dev/random&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/dev/urandom&amp;lt;/code&amp;gt; as that would take a lot longer and make it take a lot longer to transfer the image between devices.&lt;br /&gt;
&lt;br /&gt;
Mount the image file to a loop-device and create a file system on it.  Without a file system, you cannot yet mount the image to a directory, only to a block-device. So do &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -f&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and remember the output. Replace every &amp;quot;LOOP&amp;quot; in the following commands by the output of the above command. First, assign the image to a block device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup LOOP IMAGE.img&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the file system on it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mkfs -t ext4 LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, detach the image from the loop device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -d LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you get command not found errors, just install the missing programmes. Now, create the directory and mount the image file to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir jessie&lt;br /&gt;
sudo mount -o loop IMAGE.img $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;quot;&amp;lt;code&amp;gt;pwd&amp;lt;/code&amp;gt;&amp;quot; will make sure you give mount an absolute path to your current working directory. Now, use the directory &amp;quot;jessie&amp;quot; with debootstrap as explained above (the command including the --foreign flag). After you're finished, umount the image via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo umount $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and create an archive of the image file (will compress all the zeroes in the archive to almost nothing) and transfer that to your phone. Both SD-card and internal storage are fine. On your phone, create the directory &amp;quot;jessie&amp;quot; somewhere on the internal storage, mount the image to it and perform the second stage.&lt;br /&gt;
&lt;br /&gt;
You should now have a nice chroot on your phone that does not waste internal storage space.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=64</id>
		<title>Debian Chroot</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=64"/>
		<updated>2017-11-22T19:56:02Z</updated>

		<summary type="html">&lt;p&gt;Chris: /* 2) Using phone only */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following was written by Torsten Sachse and [https://lists.launchpad.net/ubuntu-phone/msg13344.html posted to the Ubuntu Phone email list on 16 Jun 2015] and reproduction was permitted under the terms of the GPL. There is also [http://askubuntu.com/a/678031 a updated version on Ask Ubuntu], see also [https://askubuntu.com/questions/620740/recommended-way-to-install-regularcli-deb-packages-on-ubuntu-phone/623311 this thread on Ask Ubuntu].&lt;br /&gt;
&lt;br /&gt;
== Debian Chroot ==&lt;br /&gt;
&lt;br /&gt;
This is a simple guide describing how to set up a chroot on a Ubuntu touch device. It also explains how to set it up so that the chroot is located on the SD-card to save internal storage space and goes into some detail about why simply installing the chroot on an SD-card is not possible.&lt;br /&gt;
&lt;br /&gt;
The guide is structured as follows:&lt;br /&gt;
&lt;br /&gt;
# Comments on file systems and permissions&lt;br /&gt;
# Using phone only&lt;br /&gt;
# Using computer and phone (recommended)&lt;br /&gt;
# Unsing an image file (recommended)&lt;br /&gt;
&lt;br /&gt;
== 1) Comments on file systems and permissions ==&lt;br /&gt;
&lt;br /&gt;
Only some file system types support file permissions in a way the chroot needs them. An SD-card likely uses FAT32 which does not support any type of permissions and, hence, the chroot can't run on it.  The permissions reported by commands like &amp;quot;&amp;lt;code&amp;gt;ls -l&amp;lt;/code&amp;gt;&amp;quot; do not have any significance on such file systems. Some Android handsets for instance support EXT3 or ECT4 on their SD-cards making installing a chroot a lot easier.&lt;br /&gt;
&lt;br /&gt;
== 2) Using phone only == &lt;br /&gt;
&lt;br /&gt;
'''(not recommended since it breaks over the air updates)''' &lt;br /&gt;
&lt;br /&gt;
It is possible to install debootstrap on the phone by remounting the system as read-write and executing the following commands. At least it worked on my BQ on r22. Imagine you want to install your chroot into the directory &amp;quot;jessie&amp;quot; which should reside in the current working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mount / -o remount,rw&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install debootstrap&lt;br /&gt;
sudo debootstrap --arch=armhf jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This only works on the internal storage without what's explained in section 4).&lt;br /&gt;
&lt;br /&gt;
Or for stretch:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mount / -o remount,rw&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install debootstrap debian-archive-keyring&lt;br /&gt;
mkdir /home/phablet/debian&lt;br /&gt;
cd /home/phablet&lt;br /&gt;
sudo debootstrap --arch=armhf stretch ./debian http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3) Using computer and phone ==&lt;br /&gt;
&lt;br /&gt;
The problem with this debootstrap-command failing your average computer is that your computer cannot execute binaries compiled for the ARM architechture. This is why you have to add the option &amp;lt;code&amp;gt;--foreign&amp;lt;/code&amp;gt; to debootstrap which tells it to only download all packages and leave anything that needs executing of any of the installed binaries to another system. So do (sudo might not be needed):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo debootstrap --arch=armhf --foreign jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were to install an i386 architechture on a x86_64 system, you would not have to specify the &amp;lt;code&amp;gt;--foreign&amp;lt;/code&amp;gt; flag as both should be able to run on an ordinary 64-bit processor although they're different architechrures.&lt;br /&gt;
&lt;br /&gt;
Now best create a tar archive from this which you then copy to your phone. It does not matter whether the archive is put on the SD-card or the internal storage. The second command is needed to turn on ssh support, which is reset upon every reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -cvzf jessie.tar.gz jessie&lt;br /&gt;
sudo service ssh start&lt;br /&gt;
scp jessie.tar.gz phablet@ubuntu-phablet:DIRECTORY_OF_YOUR_CHOICE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you only have to extract the archive wherever you want the new directory &amp;quot;jessie&amp;quot; to reside. Without what's expained in section 4), this will only work on your internal storage.  Then, you only have to go into your chroot and finish the installation process. So do on the phone (the first command is needed since the terminal app is somehow restricted to execute binaries):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh localhost&lt;br /&gt;
tar -xvzf jessie.tar.gz&lt;br /&gt;
sudo chroot jessie /bin/bash&lt;br /&gt;
/debootstrap/debootstrap --second-stage&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to chroot into your new system using the third of the above commands.&lt;br /&gt;
&lt;br /&gt;
== 4) Using an image file ==&lt;br /&gt;
&lt;br /&gt;
First, create an image file on the system on which you execute the first debootstrap command. To create an 1GB image, do&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=IMAGE.img bs=1G count=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the B in GB is left out. &amp;quot;if&amp;quot; stands for &amp;quot;input file&amp;quot;, &amp;quot;of&amp;quot; for &amp;quot;output file&amp;quot; and &amp;quot;bs&amp;quot; for &amp;quot;block size&amp;quot;. There are more efficient commands out there, but those only work on certain types of file systems, AFAIK. This one also works on an SD-card or a tempfs. Please note the use of &amp;lt;code&amp;gt;/dev/zero&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;/dev/random&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/dev/urandom&amp;lt;/code&amp;gt; as that would take a lot longer and make it take a lot longer to transfer the image between devices.&lt;br /&gt;
&lt;br /&gt;
Mount the image file to a loop-device and create a file system on it.  Without a file system, you cannot yet mount the image to a directory, only to a block-device. So do &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -f&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and remember the output. Replace every &amp;quot;LOOP&amp;quot; in the following commands by the output of the above command. First, assign the image to a block device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup LOOP IMAGE.img&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the file system on it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mkfs -t ext4 LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, detach the image from the loop device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -d LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you get command not found errors, just install the missing programmes. Now, create the directory and mount the image file to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir jessie&lt;br /&gt;
sudo mount -o loop IMAGE.img $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;quot;&amp;lt;code&amp;gt;pwd&amp;lt;/code&amp;gt;&amp;quot; will make sure you give mount an absolute path to your current working directory. Now, use the directory &amp;quot;jessie&amp;quot; with debootstrap as explained above (the command including the --foreign flag). After you're finished, umount the image via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo umount $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and create an archive of the image file (will compress all the zeroes in the archive to almost nothing) and transfer that to your phone. Both SD-card and internal storage are fine. On your phone, create the directory &amp;quot;jessie&amp;quot; somewhere on the internal storage, mount the image to it and perform the second stage.&lt;br /&gt;
&lt;br /&gt;
You should now have a nice chroot on your phone that does not waste internal storage space.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Resize_Root&amp;diff=63</id>
		<title>Resize Root</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Resize_Root&amp;diff=63"/>
		<updated>2016-06-01T22:10:00Z</updated>

		<summary type="html">&lt;p&gt;Chris: Created page with &amp;quot;See this script: https://github.com/plasma-mobile/plasma-phone-dev-setup/blob/master/usr/bin/resize-root-partition&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See this script: https://github.com/plasma-mobile/plasma-phone-dev-setup/blob/master/usr/bin/resize-root-partition&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=62</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=62"/>
		<updated>2016-06-01T22:09:27Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki has been created to document things you can do on the command line on an Ubuntu Phone.&lt;br /&gt;
&lt;br /&gt;
See also the [https://www.gitbook.com/book/gurucubano/bq-aquaris-e-4-5-ubuntu-phone/details BQ Aquaris E 4.5 Ubuntu phone book] on gitbooks.&lt;br /&gt;
&lt;br /&gt;
People with accounts with administrator permissions can [https://ubuntu-phone.host1.webarch.net/w/index.php?title=Special:UserLogin/signup create accounts for other people].&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&lt;br /&gt;
# [[SSH access through Wifi]] &amp;amp;mdash; How to get SSH access to the Ubuntu Phone via Wifi&lt;br /&gt;
# [[USB networking ]] &amp;amp;mdash; How to get SSH access through USB networking&lt;br /&gt;
# [[Install Packages]] &amp;amp;mdash; make the filesystem read-write and install additional &amp;lt;code&amp;gt;.deb&amp;lt;/code&amp;gt; packages&lt;br /&gt;
# [[Find Phone]] &amp;amp;mdash; this is a script to find your phone on the local network by it's Mac address&lt;br /&gt;
# [[Encrypted Home]] &amp;amp;mdash; add an additional account and create an encrypted home directory for it&lt;br /&gt;
# [[Proxy Web Traffic]] &amp;amp;mdash; install privoxy to filter out adverts and optionally forward web traffic to a ssh tunnel&lt;br /&gt;
# [[Debian Chroot]] &amp;amp;mdash; install a Debian system on an Ubuntu Phone&lt;br /&gt;
# [[Firewall]] &amp;amp;mdash; install and configure a firewall using iptables &lt;br /&gt;
# [[Resize Root]] &amp;amp;mdash; of course this isn't recommended!&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a test of the syntax highlighting&lt;br /&gt;
echo &amp;quot;hello world!&amp;quot; | sed 's/world/Ubuntu phone/'&lt;br /&gt;
hello Ubuntu phone!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=61</id>
		<title>Debian Chroot</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=61"/>
		<updated>2016-05-18T07:45:05Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following was written by Torsten Sachse and [https://lists.launchpad.net/ubuntu-phone/msg13344.html posted to the Ubuntu Phone email list on 16 Jun 2015] and reproduction was permitted under the terms of the GPL. There is also [http://askubuntu.com/a/678031 a updated version on Ask Ubuntu], see also [https://askubuntu.com/questions/620740/recommended-way-to-install-regularcli-deb-packages-on-ubuntu-phone/623311 this thread on Ask Ubuntu].&lt;br /&gt;
&lt;br /&gt;
== Debian Chroot ==&lt;br /&gt;
&lt;br /&gt;
This is a simple guide describing how to set up a chroot on a Ubuntu touch device. It also explains how to set it up so that the chroot is located on the SD-card to save internal storage space and goes into some detail about why simply installing the chroot on an SD-card is not possible.&lt;br /&gt;
&lt;br /&gt;
The guide is structured as follows:&lt;br /&gt;
&lt;br /&gt;
# Comments on file systems and permissions&lt;br /&gt;
# Using phone only&lt;br /&gt;
# Using computer and phone (recommended)&lt;br /&gt;
# Unsing an image file (recommended)&lt;br /&gt;
&lt;br /&gt;
== 1) Comments on file systems and permissions ==&lt;br /&gt;
&lt;br /&gt;
Only some file system types support file permissions in a way the chroot needs them. An SD-card likely uses FAT32 which does not support any type of permissions and, hence, the chroot can't run on it.  The permissions reported by commands like &amp;quot;&amp;lt;code&amp;gt;ls -l&amp;lt;/code&amp;gt;&amp;quot; do not have any significance on such file systems. Some Android handsets for instance support EXT3 or ECT4 on their SD-cards making installing a chroot a lot easier.&lt;br /&gt;
&lt;br /&gt;
== 2) Using phone only == &lt;br /&gt;
&lt;br /&gt;
'''(not recommended since it breaks over the air updates)''' &lt;br /&gt;
&lt;br /&gt;
It is possible to install debootstrap on the phone by remounting the system as read-write and executing the following commands. At least it worked on my BQ on r22. Imagine you want to install your chroot into the directory &amp;quot;jessie&amp;quot; which should reside in the current working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mount / -o remount,rw&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install debootstrap&lt;br /&gt;
sudo debootstrap --arch=armhf jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This only works on the internal storage without what's explained in section 4).&lt;br /&gt;
&lt;br /&gt;
== 3) Using computer and phone ==&lt;br /&gt;
&lt;br /&gt;
The problem with this debootstrap-command failing your average computer is that your computer cannot execute binaries compiled for the ARM architechture. This is why you have to add the option &amp;lt;code&amp;gt;--foreign&amp;lt;/code&amp;gt; to debootstrap which tells it to only download all packages and leave anything that needs executing of any of the installed binaries to another system. So do (sudo might not be needed):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo debootstrap --arch=armhf --foreign jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were to install an i386 architechture on a x86_64 system, you would not have to specify the &amp;lt;code&amp;gt;--foreign&amp;lt;/code&amp;gt; flag as both should be able to run on an ordinary 64-bit processor although they're different architechrures.&lt;br /&gt;
&lt;br /&gt;
Now best create a tar archive from this which you then copy to your phone. It does not matter whether the archive is put on the SD-card or the internal storage. The second command is needed to turn on ssh support, which is reset upon every reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -cvzf jessie.tar.gz jessie&lt;br /&gt;
sudo service ssh start&lt;br /&gt;
scp jessie.tar.gz phablet@ubuntu-phablet:DIRECTORY_OF_YOUR_CHOICE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you only have to extract the archive wherever you want the new directory &amp;quot;jessie&amp;quot; to reside. Without what's expained in section 4), this will only work on your internal storage.  Then, you only have to go into your chroot and finish the installation process. So do on the phone (the first command is needed since the terminal app is somehow restricted to execute binaries):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh localhost&lt;br /&gt;
tar -xvzf jessie.tar.gz&lt;br /&gt;
sudo chroot jessie /bin/bash&lt;br /&gt;
/debootstrap/debootstrap --second-stage&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to chroot into your new system using the third of the above commands.&lt;br /&gt;
&lt;br /&gt;
== 4) Using an image file ==&lt;br /&gt;
&lt;br /&gt;
First, create an image file on the system on which you execute the first debootstrap command. To create an 1GB image, do&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=IMAGE.img bs=1G count=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the B in GB is left out. &amp;quot;if&amp;quot; stands for &amp;quot;input file&amp;quot;, &amp;quot;of&amp;quot; for &amp;quot;output file&amp;quot; and &amp;quot;bs&amp;quot; for &amp;quot;block size&amp;quot;. There are more efficient commands out there, but those only work on certain types of file systems, AFAIK. This one also works on an SD-card or a tempfs. Please note the use of &amp;lt;code&amp;gt;/dev/zero&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;/dev/random&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/dev/urandom&amp;lt;/code&amp;gt; as that would take a lot longer and make it take a lot longer to transfer the image between devices.&lt;br /&gt;
&lt;br /&gt;
Mount the image file to a loop-device and create a file system on it.  Without a file system, you cannot yet mount the image to a directory, only to a block-device. So do &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -f&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and remember the output. Replace every &amp;quot;LOOP&amp;quot; in the following commands by the output of the above command. First, assign the image to a block device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup LOOP IMAGE.img&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the file system on it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mkfs -t ext4 LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, detach the image from the loop device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -d LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you get command not found errors, just install the missing programmes. Now, create the directory and mount the image file to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir jessie&lt;br /&gt;
sudo mount -o loop IMAGE.img $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;quot;&amp;lt;code&amp;gt;pwd&amp;lt;/code&amp;gt;&amp;quot; will make sure you give mount an absolute path to your current working directory. Now, use the directory &amp;quot;jessie&amp;quot; with debootstrap as explained above (the command including the --foreign flag). After you're finished, umount the image via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo umount $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and create an archive of the image file (will compress all the zeroes in the archive to almost nothing) and transfer that to your phone. Both SD-card and internal storage are fine. On your phone, create the directory &amp;quot;jessie&amp;quot; somewhere on the internal storage, mount the image to it and perform the second stage.&lt;br /&gt;
&lt;br /&gt;
You should now have a nice chroot on your phone that does not waste internal storage space.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=60</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=60"/>
		<updated>2016-05-16T20:45:21Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki has been created to document things you can do on the command line on an Ubuntu Phone.&lt;br /&gt;
&lt;br /&gt;
See also the [https://www.gitbook.com/book/gurucubano/bq-aquaris-e-4-5-ubuntu-phone/details BQ Aquaris E 4.5 Ubuntu phone book] on gitbooks.&lt;br /&gt;
&lt;br /&gt;
People with accounts with administrator permissions can [https://ubuntu-phone.host1.webarch.net/w/index.php?title=Special:UserLogin/signup create accounts for other people].&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&lt;br /&gt;
# [[SSH access through Wifi]] &amp;amp;mdash; How to get SSH access to the Ubuntu Phone via Wifi&lt;br /&gt;
# [[USB networking ]] &amp;amp;mdash; How to get SSH access through USB networking&lt;br /&gt;
# [[Install Packages]] &amp;amp;mdash; make the filesystem read-write and install additional &amp;lt;code&amp;gt;.deb&amp;lt;/code&amp;gt; packages&lt;br /&gt;
# [[Find Phone]] &amp;amp;mdash; this is a script to find your phone on the local network by it's Mac address&lt;br /&gt;
# [[Encrypted Home]] &amp;amp;mdash; add an additional account and create an encrypted home directory for it&lt;br /&gt;
# [[Proxy Web Traffic]] &amp;amp;mdash; install privoxy to filter out adverts and optionally forward web traffic to a ssh tunnel&lt;br /&gt;
# [[Debian Chroot]] &amp;amp;mdash; install a Debian system on an Ubuntu Phone&lt;br /&gt;
# [[Firewall]] &amp;amp;mdash; install and configure a firewall using iptables &lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a test of the syntax highlighting&lt;br /&gt;
echo &amp;quot;hello world!&amp;quot; | sed 's/world/Ubuntu phone/'&lt;br /&gt;
hello Ubuntu phone!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=59</id>
		<title>Proxy Web Traffic</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=59"/>
		<updated>2015-10-16T21:29:58Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is an [https://bugs.launchpad.net/canonical-devices-system-image/+bug/1497210 assigned bug] to sort out blocking webbugs and trackers, in the meantime there is Privoxy...&lt;br /&gt;
&lt;br /&gt;
== Privoxy ==&lt;br /&gt;
&lt;br /&gt;
Follow [[Install Packages]] to install &amp;lt;code&amp;gt;privoxy&amp;lt;/code&amp;gt;, then start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install privoxy&lt;br /&gt;
service privoxy start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp_proxy=http://localhost:8118/&lt;br /&gt;
http_proxy=http://localhost:8118/&lt;br /&gt;
https_proxy=http://localhost:8118/&lt;br /&gt;
FTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTPS_PROXY=http://localhost:8118/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot the phone to change the root filesystem to read-only and to ensure that sessions have the env vars above set (you can check in a terminal with &amp;lt;code&amp;gt;printenv&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Visit http://config.privoxy.org/ to test it is working.&lt;br /&gt;
&lt;br /&gt;
== SSH tunnel ==&lt;br /&gt;
&lt;br /&gt;
Set the root file system to be read-write and edit &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt; adding this line with the port the ssh tunnel will be on, in this case 3128:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward-socks5   /               127.0.0.1:3128 .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a list of local networks you don't want the tunnel to be used for (so you can use the web browser to login to public wifi networks for example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward         192.168.*.*/     .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a script to start a ssh tunnel, eg &amp;lt;code&amp;gt;~/bin/proxy&amp;lt;/code&amp;gt; containing something like this (remove the &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; for non-verbose output in the terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  REMOTE_SERVER=$1&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Run this script like this:&amp;quot;&lt;br /&gt;
  echo &amp;quot;/bin/bash $0 server-name-from-ssh-config-file&amp;quot;&lt;br /&gt;
  exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
ssh -vTnN -C -F &amp;quot;$HOME/.ssh/config&amp;quot; -D 3128 $REMOTE_SERVER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This works best if you have short names for servers in your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; and have ssh keys set up. &lt;br /&gt;
&lt;br /&gt;
Start the tunnel (note you might need to run it as follows unless you ssh to localhost first and have &amp;lt;code&amp;gt;~/bin/&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;, then you can simply type &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt; after you &amp;lt;code&amp;gt;chmod 750 ~/bin/proxy&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
bash ~/bin/proxy your-ssh-server&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Visit a page that reports your IP address, eg https://parrot.transitionnetwork.org/myip.shtml&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If your network is very unreliable, try adding this to &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
keep-alive-timeout 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=58</id>
		<title>Debian Chroot</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=58"/>
		<updated>2015-09-25T11:29:35Z</updated>

		<summary type="html">&lt;p&gt;Chris: Added link to http://askubuntu.com/a/678031&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following was written by Torsten Sachse and [https://lists.launchpad.net/ubuntu-phone/msg13344.html posted to the Ubuntu Phone email list on 16 Jun 2015] and reproduction was permitted under the terms of the GPL. There is also [http://askubuntu.com/a/678031 a updated version on Ask Ubuntu].&lt;br /&gt;
&lt;br /&gt;
== Debian Chroot ==&lt;br /&gt;
&lt;br /&gt;
This is a simple guide describing how to set up a chroot on a Ubuntu touch device. It also explains how to set it up so that the chroot is located on the SD-card to save internal storage space and goes into some detail about why simply installing the chroot on an SD-card is not possible.&lt;br /&gt;
&lt;br /&gt;
The guide is structured as follows:&lt;br /&gt;
&lt;br /&gt;
# Comments on file systems and permissions&lt;br /&gt;
# Using phone only&lt;br /&gt;
# Using computer and phone (recommended)&lt;br /&gt;
# Unsing an image file (recommended)&lt;br /&gt;
&lt;br /&gt;
== 1) Comments on file systems and permissions ==&lt;br /&gt;
&lt;br /&gt;
Only some file system types support file permissions in a way the chroot needs them. An SD-card likely uses FAT32 which does not support any type of permissions and, hence, the chroot can't run on it.  The permissions reported by commands like &amp;quot;&amp;lt;code&amp;gt;ls -l&amp;lt;/code&amp;gt;&amp;quot; do not have any significance on such file systems. Some Android handsets for instance support EXT3 or ECT4 on their SD-cards making installing a chroot a lot easier.&lt;br /&gt;
&lt;br /&gt;
== 2) Using phone only == &lt;br /&gt;
&lt;br /&gt;
'''(not recommended since it breaks over the air updates)''' &lt;br /&gt;
&lt;br /&gt;
It is possible to install debootstrap on the phone by remounting the system as read-write and executing the following commands. At least it worked on my BQ on r22. Imagine you want to install your chroot into the directory &amp;quot;jessie&amp;quot; which should reside in the current working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mount / -o remount,rw&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install debootstrap&lt;br /&gt;
sudo debootstrap --arch=armhf jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This only works on the internal storage without what's explained in section 4).&lt;br /&gt;
&lt;br /&gt;
== 3) Using computer and phone ==&lt;br /&gt;
&lt;br /&gt;
The problem with this debootstrap-command failing your average computer is that your computer cannot execute binaries compiled for the ARM architechture. This is why you have to add the option &amp;lt;code&amp;gt;--foreign&amp;lt;/code&amp;gt; to debootstrap which tells it to only download all packages and leave anything that needs executing of any of the installed binaries to another system. So do (sudo might not be needed):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo debootstrap --arch=armhf --foreign jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were to install an i386 architechture on a x86_64 system, you would not have to specify the &amp;lt;code&amp;gt;--foreign&amp;lt;/code&amp;gt; flag as both should be able to run on an ordinary 64-bit processor although they're different architechrures.&lt;br /&gt;
&lt;br /&gt;
Now best create a tar archive from this which you then copy to your phone. It does not matter whether the archive is put on the SD-card or the internal storage. The second command is needed to turn on ssh support, which is reset upon every reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -cvzf jessie.tar.gz jessie&lt;br /&gt;
sudo service ssh start&lt;br /&gt;
scp jessie.tar.gz phablet@ubuntu-phablet:DIRECTORY_OF_YOUR_CHOICE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you only have to extract the archive wherever you want the new directory &amp;quot;jessie&amp;quot; to reside. Without what's expained in section 4), this will only work on your internal storage.  Then, you only have to go into your chroot and finish the installation process. So do on the phone (the first command is needed since the terminal app is somehow restricted to execute binaries):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh localhost&lt;br /&gt;
tar -xvzf jessie.tar.gz&lt;br /&gt;
sudo chroot jessie /bin/bash&lt;br /&gt;
/debootstrap/debootstrap --second-stage&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to chroot into your new system using the third of the above commands.&lt;br /&gt;
&lt;br /&gt;
== 4) Using an image file ==&lt;br /&gt;
&lt;br /&gt;
First, create an image file on the system on which you execute the first debootstrap command. To create an 1GB image, do&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=IMAGE.img bs=1G count=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the B in GB is left out. &amp;quot;if&amp;quot; stands for &amp;quot;input file&amp;quot;, &amp;quot;of&amp;quot; for &amp;quot;output file&amp;quot; and &amp;quot;bs&amp;quot; for &amp;quot;block size&amp;quot;. There are more efficient commands out there, but those only work on certain types of file systems, AFAIK. This one also works on an SD-card or a tempfs. Please note the use of &amp;lt;code&amp;gt;/dev/zero&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;/dev/random&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/dev/urandom&amp;lt;/code&amp;gt; as that would take a lot longer and make it take a lot longer to transfer the image between devices.&lt;br /&gt;
&lt;br /&gt;
Mount the image file to a loop-device and create a file system on it.  Without a file system, you cannot yet mount the image to a directory, only to a block-device. So do &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -f&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and remember the output. Replace every &amp;quot;LOOP&amp;quot; in the following commands by the output of the above command. First, assign the image to a block device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup LOOP IMAGE.img&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the file system on it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mkfs -t ext4 LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, detach the image from the loop device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -d LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you get command not found errors, just install the missing programmes. Now, create the directory and mount the image file to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir jessie&lt;br /&gt;
sudo mount -o loop IMAGE.img $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;quot;&amp;lt;code&amp;gt;pwd&amp;lt;/code&amp;gt;&amp;quot; will make sure you give mount an absolute path to your current working directory. Now, use the directory &amp;quot;jessie&amp;quot; with debootstrap as explained above (the command including the --foreign flag). After you're finished, umount the image via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo umount $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and create an archive of the image file (will compress all the zeroes in the archive to almost nothing) and transfer that to your phone. Both SD-card and internal storage are fine. On your phone, create the directory &amp;quot;jessie&amp;quot; somewhere on the internal storage, mount the image to it and perform the second stage.&lt;br /&gt;
&lt;br /&gt;
You should now have a nice chroot on your phone that does not waste internal storage space.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Firewall&amp;diff=57</id>
		<title>Firewall</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Firewall&amp;diff=57"/>
		<updated>2015-09-18T10:48:45Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See [[Install Packages]] for notes on how to install &amp;lt;code&amp;gt;iptables-persistent&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you only want to accept &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; and pings edit &amp;lt;code&amp;gt;/etc/iptables/rules.v4&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable&lt;br /&gt;
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT&lt;br /&gt;
-A INPUT -m limit --limit 5/min -j LOG --log-prefix &amp;quot;iptables denied: &amp;quot; --log-level 7&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-port-unreachable&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-port-unreachable&lt;br /&gt;
-A OUTPUT -j ACCEPT&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And reload the rules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo iptables-restore &amp;lt; /etc/iptables/rules.v4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disable IPv6 ==&lt;br /&gt;
&lt;br /&gt;
If you are not using IPv6 you can disable it by first setting the root files system to be read-write and then running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;net.ipv6.conf.all.disable_ipv6 = 1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
echo &amp;quot;net.ipv6.conf.default.disable_ipv6 = 1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
echo &amp;quot;net.ipv6.conf.lo.disable_ipv6 = 1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And after the device has been rebooted it will only support IPv4.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Firewall&amp;diff=56</id>
		<title>Firewall</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Firewall&amp;diff=56"/>
		<updated>2015-09-18T10:48:22Z</updated>

		<summary type="html">&lt;p&gt;Chris: Page created&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See [[Install Packages]] for notes on how to install &amp;lt;code&amp;gt;iptables-persistent&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you only want to accept &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; and pings edit &amp;lt;code&amp;gt;/etc/iptables/rules.v4&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable&lt;br /&gt;
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT&lt;br /&gt;
-A INPUT -m limit --limit 5/min -j LOG --log-prefix &amp;quot;iptables denied: &amp;quot; --log-level 7&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-port-unreachable&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-port-unreachable&lt;br /&gt;
-A OUTPUT -j ACCEPT&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And reload the rules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo iptables-restore &amp;lt; /etc/iptables/rules.v4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disable IPv6 ==&lt;br /&gt;
&lt;br /&gt;
If you are not using IPv6 you can disable it by first setting the root files system to be read-write and then running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;net.ipv6.conf.all.disable_ipv6 = 1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
echo &amp;quot;net.ipv6.conf.default.disable_ipv6 = 1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
echo &amp;quot;net.ipv6.conf.lo.disable_ipv6 = 1&amp;quot; &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And after the device has been rebooted it will only support IPv4.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=55</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=55"/>
		<updated>2015-09-18T10:40:17Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki has been created to document things you can do on the command line on an Ubuntu Phone.&lt;br /&gt;
&lt;br /&gt;
People with accounts with administrator permissions can [https://ubuntu-phone.host1.webarch.net/w/index.php?title=Special:UserLogin/signup create accounts for other people].&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&lt;br /&gt;
# [[SSH access through Wifi]] &amp;amp;mdash; How to get SSH access to the Ubuntu Phone via Wifi&lt;br /&gt;
# [[USB networking ]] &amp;amp;mdash; How to get SSH access through USB networking&lt;br /&gt;
# [[Install Packages]] &amp;amp;mdash; make the filesystem read-write and install additional &amp;lt;code&amp;gt;.deb&amp;lt;/code&amp;gt; packages&lt;br /&gt;
# [[Find Phone]] &amp;amp;mdash; this is a script to find your phone on the local network by it's Mac address&lt;br /&gt;
# [[Encrypted Home]] &amp;amp;mdash; add an additional account and create an encrypted home directory for it&lt;br /&gt;
# [[Proxy Web Traffic]] &amp;amp;mdash; install privoxy to filter out adverts and optionally forward web traffic to a ssh tunnel&lt;br /&gt;
# [[Debian Chroot]] &amp;amp;mdash; install a Debian system on an Ubuntu Phone&lt;br /&gt;
# [[Firewall]] &amp;amp;mdash; install and configure a firewall using iptables &lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a test of the syntax highlighting&lt;br /&gt;
echo &amp;quot;hello world!&amp;quot; | sed 's/world/Ubuntu phone/'&lt;br /&gt;
hello Ubuntu phone!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=54</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=54"/>
		<updated>2015-09-18T10:05:54Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki has been created to document things you can do on the command line on an Ubuntu Phone.&lt;br /&gt;
&lt;br /&gt;
People with accounts with administrator permissions can [https://ubuntu-phone.host1.webarch.net/w/index.php?title=Special:UserLogin/signup create accounts for other people].&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&lt;br /&gt;
# [[SSH access through Wifi]] &amp;amp;mdash; How to get SSH access to the Ubuntu Phone via Wifi&lt;br /&gt;
# [[USB networking ]] &amp;amp;mdash; How to get SSH access through USB networking&lt;br /&gt;
# [[Install Packages]] &amp;amp;mdash; make the filesystem read-write and install additional &amp;lt;code&amp;gt;.deb&amp;lt;/code&amp;gt; packages&lt;br /&gt;
# [[Find Phone]] &amp;amp;mdash; this is a script to find your phone on the local network by it's Mac address&lt;br /&gt;
# [[Encrypted Home]] &amp;amp;mdash; add an additional account and create an encrypted home directory for it&lt;br /&gt;
# [[Proxy Web Traffic]] &amp;amp;mdash; install privoxy to filter out adverts and optionally forward web traffic to a ssh tunnel&lt;br /&gt;
# [[Debian Chroot]] &amp;amp;mdash; install a Debian system on an Ubuntu Phone&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a test of the syntax highlighting&lt;br /&gt;
echo &amp;quot;hello world!&amp;quot; | sed 's/world/Ubuntu phone/'&lt;br /&gt;
hello Ubuntu phone!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=53</id>
		<title>Encrypted Home</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=53"/>
		<updated>2015-09-18T09:57:19Z</updated>

		<summary type="html">&lt;p&gt;Chris: Added ramdon ~/tmp/ script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Create an encrypted &amp;lt;code&amp;gt;/home/user/&amp;lt;/code&amp;gt; directory, this needs some additional packages to be installed, see [[Install Packages]], set the wanted username as an environmental variable first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
export NEWUSER=&amp;quot;username&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a file to use as a disk (set the size as required, it is 1G in this example) and encrypt&lt;br /&gt;
and format it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fallocate -l 1G /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksFormat /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER&lt;br /&gt;
mkfs.ext4 /dev/mapper/$NEWUSER&lt;br /&gt;
mkdir /home/$NEWUSER&lt;br /&gt;
mount /dev/mapper/$NEWUSER /home/$NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new user and add them to the sudo group:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
adduser --disabled-password $NEWUSER&lt;br /&gt;
addgroup $NEWUSER&lt;br /&gt;
adduser $NEWUSER $NEWUSER&lt;br /&gt;
usermod -a -G sudo $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After doing the above you can su to the new user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And you now have a user account with an encrypted filesystem.&lt;br /&gt;
&lt;br /&gt;
You can add the following to /home/phablet/.bash_aliases for mounting&lt;br /&gt;
the disk in future (change $NEWUSER to your username first!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
alias mnt-$NEWUSER='sudo cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER; sudo e2fsck /dev/mapper/$NEWUSER ; sudo mount /dev/mapper/$NEWUSER /home/$NEWUSER'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Random encrypted ~/tmp/ ==&lt;br /&gt;
&lt;br /&gt;
If you would like a &amp;lt;code&amp;gt;~/tmp/&amp;lt;/code&amp;gt; directory which is randomly encrypted and therefore impossible to decrypt after the device has been power cycled then you can create &amp;lt;code&amp;gt;/home/phablet/bin/mktmpfs&amp;lt;/code&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  USER=$1&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Please supply a username for the temp partition&amp;quot;&lt;br /&gt;
  exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
umount /home/$USER/tmp&lt;br /&gt;
cryptsetup luksClose $USER-tmp&lt;br /&gt;
&lt;br /&gt;
RANDOM_FILE=/tmp/$(pwgen -n 12)&lt;br /&gt;
touch $RANDOM_FILE&lt;br /&gt;
chmod 600 $RANDOM_FILE&lt;br /&gt;
echo $(pwgen -n 128) &amp;gt; $RANDOM_FILE&lt;br /&gt;
&lt;br /&gt;
dd if=/dev/urandom of=/home/$USER.tmp.img iflag=fullblock bs=1M count=6&lt;br /&gt;
#fallocate -l 10M /home/$USER.tmp.img &lt;br /&gt;
chmod 700 /home/$USER.tmp.img&lt;br /&gt;
cryptsetup luksFormat /home/$USER.tmp.img $RANDOM_FILE&lt;br /&gt;
cryptsetup luksOpen /home/$USER.tmp.img $USER-tmp --key-file $RANDOM_FILE&lt;br /&gt;
mkfs.ext2 /dev/mapper/$USER-tmp&lt;br /&gt;
mount /dev/mapper/$USER-tmp /home/$USER/tmp&lt;br /&gt;
chmod 700 /home/$USER/tmp&lt;br /&gt;
chown -R $USER:$USER /home/$USER/tmp&lt;br /&gt;
shred $RANDOM_FILE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And then run it as the &amp;lt;code&amp;gt;phablet&amp;lt;/code&amp;gt; user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo bash ~/bin/mktmpfs USER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=52</id>
		<title>Encrypted Home</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=52"/>
		<updated>2015-08-28T13:17:22Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Create an encrypted &amp;lt;code&amp;gt;/home/user/&amp;lt;/code&amp;gt; directory, this needs some additional packages to be installed, see [[Install Packages]], set the wanted username as an environmental variable first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
export NEWUSER=&amp;quot;username&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a file to use as a disk (set the size as required, it is 1G in this example) and encrypt&lt;br /&gt;
and format it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fallocate -l 1G /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksFormat /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER&lt;br /&gt;
mkfs.ext4 /dev/mapper/$NEWUSER&lt;br /&gt;
mkdir /home/$NEWUSER&lt;br /&gt;
mount /dev/mapper/$NEWUSER /home/$NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new user and add them to the sudo group:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
adduser --disabled-password $NEWUSER&lt;br /&gt;
addgroup $NEWUSER&lt;br /&gt;
adduser $NEWUSER $NEWUSER&lt;br /&gt;
usermod -a -G sudo $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After doing the above you can su to the new user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And you now have a user account with an encrypted filesystem.&lt;br /&gt;
&lt;br /&gt;
You can add the following to /home/phablet/.bash_aliases for mounting&lt;br /&gt;
the disk in future (change $NEWUSER to your username first!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
alias mnt-$NEWUSER='sudo cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER; sudo e2fsck /dev/mapper/$NEWUSER ; sudo mount /dev/mapper/$NEWUSER /home/$NEWUSER'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=51</id>
		<title>Debian Chroot</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=51"/>
		<updated>2015-08-28T13:11:07Z</updated>

		<summary type="html">&lt;p&gt;Chris: formatting...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following was written by Torsten Sachse and [https://lists.launchpad.net/ubuntu-phone/msg13344.html posted to the Ubuntu Phone email list on 16 Jun 2015] and reproduction was permitted under the terms of the GPL:&lt;br /&gt;
&lt;br /&gt;
== Debian Chroot ==&lt;br /&gt;
&lt;br /&gt;
This is a simple guide describing how to set up a chroot on a Ubuntu touch device. It also explains how to set it up so that the chroot is located on the SD-card to save internal storage space and goes into some detail about why simply installing the chroot on an SD-card is not possible.&lt;br /&gt;
&lt;br /&gt;
The guide is structured as follows:&lt;br /&gt;
&lt;br /&gt;
# Comments on file systems and permissions&lt;br /&gt;
# Using phone only&lt;br /&gt;
# Using computer and phone (recommended)&lt;br /&gt;
# Unsing an image file (recommended)&lt;br /&gt;
&lt;br /&gt;
== 1) Comments on file systems and permissions ==&lt;br /&gt;
&lt;br /&gt;
Only some file system types support file permissions in a way the chroot needs them. An SD-card likely uses FAT32 which does not support any type of permissions and, hence, the chroot can't run on it.  The permissions reported by commands like &amp;quot;&amp;lt;code&amp;gt;ls -l&amp;lt;/code&amp;gt;&amp;quot; do not have any significance on such file systems. Some Android handsets for instance support EXT3 or ECT4 on their SD-cards making installing a chroot a lot easier.&lt;br /&gt;
&lt;br /&gt;
== 2) Using phone only == &lt;br /&gt;
&lt;br /&gt;
'''(not recommended since it breaks over the air updates)''' &lt;br /&gt;
&lt;br /&gt;
It is possible to install debootstrap on the phone by remounting the system as read-write and executing the following commands. At least it worked on my BQ on r22. Imagine you want to install your chroot into the directory &amp;quot;jessie&amp;quot; which should reside in the current working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mount / -o remount,rw&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install debootstrap&lt;br /&gt;
sudo debootstrap --arch=armhf jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This only works on the internal storage without what's explained in section 4).&lt;br /&gt;
&lt;br /&gt;
== 3) Using computer and phone ==&lt;br /&gt;
&lt;br /&gt;
The problem with this debootstrap-command failing your average computer is that your computer cannot execute binaries compiled for the ARM architechture. This is why you have to add the option &amp;lt;code&amp;gt;--foreign&amp;lt;/code&amp;gt; to debootstrap which tells it to only download all packages and leave anything that needs executing of any of the installed binaries to another system. So do (sudo might not be needed):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo debootstrap --arch=armhf --foreign jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were to install an i386 architechture on a x86_64 system, you would not have to specify the &amp;lt;code&amp;gt;--foreign&amp;lt;/code&amp;gt; flag as both should be able to run on an ordinary 64-bit processor although they're different architechrures.&lt;br /&gt;
&lt;br /&gt;
Now best create a tar archive from this which you then copy to your phone. It does not matter whether the archive is put on the SD-card or the internal storage. The second command is needed to turn on ssh support, which is reset upon every reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -cvzf jessie.tar.gz jessie&lt;br /&gt;
sudo service ssh start&lt;br /&gt;
scp jessie.tar.gz phablet@ubuntu-phablet:DIRECTORY_OF_YOUR_CHOICE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you only have to extract the archive wherever you want the new directory &amp;quot;jessie&amp;quot; to reside. Without what's expained in section 4), this will only work on your internal storage.  Then, you only have to go into your chroot and finish the installation process. So do on the phone (the first command is needed since the terminal app is somehow restricted to execute binaries):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh localhost&lt;br /&gt;
tar -xvzf jessie.tar.gz&lt;br /&gt;
sudo chroot jessie /bin/bash&lt;br /&gt;
/debootstrap/debootstrap --second-stage&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to chroot into your new system using the third of the above commands.&lt;br /&gt;
&lt;br /&gt;
== 4) Using an image file ==&lt;br /&gt;
&lt;br /&gt;
First, create an image file on the system on which you execute the first debootstrap command. To create an 1GB image, do&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=IMAGE.img bs=1G count=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the B in GB is left out. &amp;quot;if&amp;quot; stands for &amp;quot;input file&amp;quot;, &amp;quot;of&amp;quot; for &amp;quot;output file&amp;quot; and &amp;quot;bs&amp;quot; for &amp;quot;block size&amp;quot;. There are more efficient commands out there, but those only work on certain types of file systems, AFAIK. This one also works on an SD-card or a tempfs. Please note the use of &amp;lt;code&amp;gt;/dev/zero&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;/dev/random&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/dev/urandom&amp;lt;/code&amp;gt; as that would take a lot longer and make it take a lot longer to transfer the image between devices.&lt;br /&gt;
&lt;br /&gt;
Mount the image file to a loop-device and create a file system on it.  Without a file system, you cannot yet mount the image to a directory, only to a block-device. So do &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -f&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and remember the output. Replace every &amp;quot;LOOP&amp;quot; in the following commands by the output of the above command. First, assign the image to a block device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup LOOP IMAGE.img&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the file system on it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mkfs -t ext4 LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, detach the image from the loop device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -d LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you get command not found errors, just install the missing programmes. Now, create the directory and mount the image file to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir jessie&lt;br /&gt;
sudo mount -o loop IMAGE.img $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;quot;&amp;lt;code&amp;gt;pwd&amp;lt;/code&amp;gt;&amp;quot; will make sure you give mount an absolute path to your current working directory. Now, use the directory &amp;quot;jessie&amp;quot; with debootstrap as explained above (the command including the --foreign flag). After you're finished, umount the image via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo umount $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and create an archive of the image file (will compress all the zeroes in the archive to almost nothing) and transfer that to your phone. Both SD-card and internal storage are fine. On your phone, create the directory &amp;quot;jessie&amp;quot; somewhere on the internal storage, mount the image to it and perform the second stage.&lt;br /&gt;
&lt;br /&gt;
You should now have a nice chroot on your phone that does not waste internal storage space.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=50</id>
		<title>Debian Chroot</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=50"/>
		<updated>2015-08-28T13:07:57Z</updated>

		<summary type="html">&lt;p&gt;Chris: formatting...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following was written by Torsten Sachse and [https://lists.launchpad.net/ubuntu-phone/msg13344.html posted to the Ubuntu Phone email list on 16 Jun 2015] and reproduction was permitted under the terms of the GPL:&lt;br /&gt;
&lt;br /&gt;
== Debian Chroot ==&lt;br /&gt;
&lt;br /&gt;
This is a simple guide describing how to set up a chroot on a Ubuntu touch device. It also explains how to set it up so that the chroot is located on the SD-card to save internal storage space and goes into some detail about why simply installing the chroot on an SD-card is not possible.&lt;br /&gt;
&lt;br /&gt;
The guide is structured as follows:&lt;br /&gt;
&lt;br /&gt;
# Comments on file systems and permissions&lt;br /&gt;
# Using phone only&lt;br /&gt;
# Using computer and phone (recommended)&lt;br /&gt;
# Unsing an image file (recommended)&lt;br /&gt;
&lt;br /&gt;
== 1) Comments on file systems and permissions ==&lt;br /&gt;
&lt;br /&gt;
Only some file system types support file permissions in a way the chroot needs them. An SD-card likely uses FAT32 which does not support any type of permissions and, hence, the chroot can't run on it.  The permissions reported by commands like &amp;quot;ls -l&amp;quot; do not have any significance on such file systems. Some Android handsets for instance support EXT3 or ECT4 on their SD-cards making installing a chroot a lot easier.&lt;br /&gt;
&lt;br /&gt;
== 2) Using phone only == &lt;br /&gt;
&lt;br /&gt;
'''(not recommended since it breaks over the air updates)''' &lt;br /&gt;
&lt;br /&gt;
It is possible to install debootstrap on the phone by remounting the system as read-write and executing the following commands. At least it worked on my BQ on r22. Imagine you want to install your chroot into the directory &amp;quot;jessie&amp;quot; which should reside in the current working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mount / -o remount,rw&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install debootstrap&lt;br /&gt;
sudo debootstrap --arch=armhf jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This only works on the internal storage without what's explained in section 4).&lt;br /&gt;
&lt;br /&gt;
== 3) Using computer and phone ==&lt;br /&gt;
&lt;br /&gt;
The problem with this debootstrap-command failing your average computer is that your computer cannot execute binaries compiled for the ARM architechture. This is why you have to add the option --foreign to debootstrap which tells it to only download all packages and leave anything that needs executing of any of the installed binaries to another system. So do (sudo might not be needed):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo debootstrap --arch=armhf --foreign jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were to install an i386 architechture on a x86_64 system, you would not have to specify the --foreign flag as both should be able to run on an ordinary 64-bit processor although they're different architechrures.&lt;br /&gt;
&lt;br /&gt;
Now best create a tar archive from this which you then copy to your phone. It does not matter whether the archive is put on the SD-card or the internal storage. The second command is needed to turn on ssh support, which is reset upon every reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -cvzf jessie.tar.gz jessie&lt;br /&gt;
sudo service ssh start&lt;br /&gt;
scp jessie.tar.gz phablet@ubuntu-phablet:DIRECTORY_OF_YOUR_CHOICE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you only have to extract the archive wherever you want the new directory &amp;quot;jessie&amp;quot; to reside. Without what's expained in section 4), this will only work on your internal storage.  Then, you only have to go into your chroot and finish the installation process. So do on the phone (the first command is needed since the terminal app is somehow restricted to execute binaries):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh localhost&lt;br /&gt;
tar -xvzf jessie.tar.gz&lt;br /&gt;
sudo chroot jessie /bin/bash&lt;br /&gt;
/debootstrap/debootstrap --second-stage&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to chroot into your new system using the third of the above commands.&lt;br /&gt;
&lt;br /&gt;
== 4) Using an image file ==&lt;br /&gt;
&lt;br /&gt;
First, create an image file on the system on which you execute the first debootstrap command. To create an 1GB image, do&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=IMAGE.img bs=1G count=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the B in GB is left out. &amp;quot;if&amp;quot; stands for &amp;quot;input file&amp;quot;, &amp;quot;of&amp;quot; for &amp;quot;output file&amp;quot; and &amp;quot;bs&amp;quot; for &amp;quot;block size&amp;quot;. There are more efficient commands out there, but those only work on certain types of file systems, AFAIK. This one also works on an SD-card or a tempfs. Please note the use of /dev/zero and not /dev/random or /dev/urandom as that would take a lot longer and make it take a lot longer to transfer the image between devices.&lt;br /&gt;
&lt;br /&gt;
Mount the image file to a loop-device and create a file system on it.  Without a file system, you cannot yet mount the image to a directory, only to a block-device. So do &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -f&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and remember the output. Replace every &amp;quot;LOOP&amp;quot; in the following commands by the output of the above command. First, assign the image to a block device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup LOOP IMAGE.img&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the file system on it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mkfs -t ext4 LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, detach the image from the loop device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -d LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you get command not found errors, just install the missing programmes. Now, create the directory and mount the image file to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir jessie&lt;br /&gt;
sudo mount -o loop IMAGE.img $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;quot;pwd&amp;quot; will make sure you give mount an absolute path to your current working directory. Now, use the directory &amp;quot;jessie&amp;quot; with debootstrap as explained above (the command including the --foreign flag). After you're finished, umount the image via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo umount $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and create an archive of the image file (will compress all the zeroes in the archive to almost nothing) and transfer that to your phone. Both SD-card and internal storage are fine. On your phone, create the directory &amp;quot;jessie&amp;quot; somewhere on the internal storage, mount the image to it and perform the second stage.&lt;br /&gt;
&lt;br /&gt;
You should now have a nice chroot on your phone that does not waste internal storage space.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=49</id>
		<title>Debian Chroot</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=49"/>
		<updated>2015-08-28T13:05:28Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following was written by Torsten Sachse and [https://lists.launchpad.net/ubuntu-phone/msg13344.html posted to the Ubuntu Phone email list on 16 Jun 2015] and reproduction was permitted under the terms of the GPL:&lt;br /&gt;
&lt;br /&gt;
== Debian Chroot ==&lt;br /&gt;
&lt;br /&gt;
This is a simple guide describing how to set up a chroot on a Ubuntu touch device. It also explains how to set it up so that the chroot is located on the SD-card to save internal storage space and goes into some detail about why simply installing the chroot on an SD-card is not possible.&lt;br /&gt;
&lt;br /&gt;
The guide is structured as follows:&lt;br /&gt;
&lt;br /&gt;
1. Comments on file systems and permissions&lt;br /&gt;
2. Using phone only&lt;br /&gt;
3. Using computer and phone (recommended)&lt;br /&gt;
4. Unsing an image file (recommended)&lt;br /&gt;
&lt;br /&gt;
1) Comments on file systems and permissions &lt;br /&gt;
&lt;br /&gt;
Only some file system types support file permissions in a way the chroot needs them. An SD-card likely uses FAT32 which does not support any type of permissions and, hence, the chroot can't run on it.  The permissions reported by commands like &amp;quot;ls -l&amp;quot; do not have any significance on such file systems. Some Android handsets for instance support EXT3 or ECT4 on their SD-cards making installing a chroot a lot easier.&lt;br /&gt;
&lt;br /&gt;
2) Using phone only (not recommended since it breaks over the air updates)&lt;br /&gt;
&lt;br /&gt;
It is possible to install debootstrap on the phone by remounting the system as read-write and executing the following commands. At least it worked on my BQ on r22. Imagine you want to install your chroot into the directory &amp;quot;jessie&amp;quot; which should reside in the current working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mount / -o remount,rw&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install debootstrap&lt;br /&gt;
sudo debootstrap --arch=armhf jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This only works on the internal storage without what's explained in section 4).&lt;br /&gt;
&lt;br /&gt;
3) Using computer and phone&lt;br /&gt;
&lt;br /&gt;
The problem with this debootstrap-command failing your average computer is that your computer cannot execute binaries compiled for the ARM architechture. This is why you have to add the option --foreign to debootstrap which tells it to only download all packages and leave anything that needs executing of any of the installed binaries to another system. So do (sudo might not be needed):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo debootstrap --arch=armhf --foreign jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were to install an i386 architechture on a x86_64 system, you would not have to specify the --foreign flag as both should be able to run on an ordinary 64-bit processor although they're different architechrures.&lt;br /&gt;
&lt;br /&gt;
Now best create a tar archive from this which you then copy to your phone. It does not matter whether the archive is put on the SD-card or the internal storage. The second command is needed to turn on ssh support, which is reset upon every reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -cvzf jessie.tar.gz jessie&lt;br /&gt;
sudo service ssh start&lt;br /&gt;
scp jessie.tar.gz phablet@ubuntu-phablet:DIRECTORY_OF_YOUR_CHOICE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you only have to extract the archive wherever you want the new directory &amp;quot;jessie&amp;quot; to reside. Without what's expained in section 4), this will only work on your internal storage.  Then, you only have to go into your chroot and finish the installation process. So do on the phone (the first command is needed since the terminal app is somehow restricted to execute binaries):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh localhost&lt;br /&gt;
tar -xvzf jessie.tar.gz&lt;br /&gt;
sudo chroot jessie /bin/bash&lt;br /&gt;
/debootstrap/debootstrap --second-stage&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to chroot into your new system using the third of the above commands.&lt;br /&gt;
&lt;br /&gt;
4) Using an image file&lt;br /&gt;
&lt;br /&gt;
First, create an image file on the system on which you execute the first debootstrap command. To create an 1GB image, do&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=IMAGE.img bs=1G count=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the B in GB is left out. &amp;quot;if&amp;quot; stands for &amp;quot;input file&amp;quot;, &amp;quot;of&amp;quot; for &amp;quot;output file&amp;quot; and &amp;quot;bs&amp;quot; for &amp;quot;block size&amp;quot;. There are more efficient commands out there, but those only work on certain types of file systems, AFAIK. This one also works on an SD-card or a tempfs. Please note the use of /dev/zero and not /dev/random or /dev/urandom as that would take a lot longer and make it take a lot longer to transfer the image between devices.&lt;br /&gt;
&lt;br /&gt;
Mount the image file to a loop-device and create a file system on it.  Without a file system, you cannot yet mount the image to a directory, only to a block-device. So do &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -f&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and remember the output. Replace every &amp;quot;LOOP&amp;quot; in the following commands by the output of the above command. First, assign the image to a block device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup LOOP IMAGE.img&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the file system on it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mkfs -t ext4 LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, detach the image from the loop device:&lt;br /&gt;
&lt;br /&gt;
sudo losetup -d LOOP&lt;br /&gt;
&lt;br /&gt;
If you get command not found errors, just install the missing programmes. Now, create the directory and mount the image file to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir jessie&lt;br /&gt;
sudo mount -o loop IMAGE.img $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;quot;pwd&amp;quot; will make sure you give mount an absolute path to your current working directory. Now, use the directory &amp;quot;jessie&amp;quot; with debootstrap as explained above (the command including the --foreign flag). After you're finished, umount the image via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo umount $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and create an archive of the image file (will compress all the zeroes in the archive to almost nothing) and transfer that to your phone. Both SD-card and internal storage are fine. On your phone, create the directory &amp;quot;jessie&amp;quot; somewhere on the internal storage, mount the image to it and perform the second stage.&lt;br /&gt;
&lt;br /&gt;
You should now have a nice chroot on your phone that does not waste internal storage space.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=48</id>
		<title>Debian Chroot</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Debian_Chroot&amp;diff=48"/>
		<updated>2015-08-28T13:03:53Z</updated>

		<summary type="html">&lt;p&gt;Chris: Copied from https://lists.launchpad.net/ubuntu-phone/msg13344.html&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following was written by Torsten Sachse and posted to the [https://lists.launchpad.net/ubuntu-phone/msg13344.html Ubuntu Phone email list on 16 Jun 2015] and reproduction was allowed on the terms of the GPL:&lt;br /&gt;
&lt;br /&gt;
== Debian Chroot ==&lt;br /&gt;
&lt;br /&gt;
This is a simple guide describing how to set up a chroot on a Ubuntu touch device. It also explains how to set it up so that the chroot is located on the SD-card to save internal storage space and goes into some detail about why simply installing the chroot on an SD-card is not possible.&lt;br /&gt;
&lt;br /&gt;
The guide is structured as follows:&lt;br /&gt;
&lt;br /&gt;
1. Comments on file systems and permissions&lt;br /&gt;
2. Using phone only&lt;br /&gt;
3. Using computer and phone (recommended)&lt;br /&gt;
4. Unsing an image file (recommended)&lt;br /&gt;
&lt;br /&gt;
1) Comments on file systems and permissions &lt;br /&gt;
&lt;br /&gt;
Only some file system types support file permissions in a way the chroot needs them. An SD-card likely uses FAT32 which does not support any type of permissions and, hence, the chroot can't run on it.  The permissions reported by commands like &amp;quot;ls -l&amp;quot; do not have any significance on such file systems. Some Android handsets for instance support EXT3 or ECT4 on their SD-cards making installing a chroot a lot easier.&lt;br /&gt;
&lt;br /&gt;
2) Using phone only (not recommended since it breaks over the air updates)&lt;br /&gt;
&lt;br /&gt;
It is possible to install debootstrap on the phone by remounting the system as read-write and executing the following commands. At least it worked on my BQ on r22. Imagine you want to install your chroot into the directory &amp;quot;jessie&amp;quot; which should reside in the current working directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mount / -o remount,rw&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install debootstrap&lt;br /&gt;
sudo debootstrap --arch=armhf jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This only works on the internal storage without what's explained in section 4).&lt;br /&gt;
&lt;br /&gt;
3) Using computer and phone&lt;br /&gt;
&lt;br /&gt;
The problem with this debootstrap-command failing your average computer is that your computer cannot execute binaries compiled for the ARM architechture. This is why you have to add the option --foreign to debootstrap which tells it to only download all packages and leave anything that needs executing of any of the installed binaries to another system. So do (sudo might not be needed):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo debootstrap --arch=armhf --foreign jessie ./jessie http://http.debian.net/debian&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were to install an i386 architechture on a x86_64 system, you would not have to specify the --foreign flag as both should be able to run on an ordinary 64-bit processor although they're different architechrures.&lt;br /&gt;
&lt;br /&gt;
Now best create a tar archive from this which you then copy to your phone. It does not matter whether the archive is put on the SD-card or the internal storage. The second command is needed to turn on ssh support, which is reset upon every reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -cvzf jessie.tar.gz jessie&lt;br /&gt;
sudo service ssh start&lt;br /&gt;
scp jessie.tar.gz phablet@ubuntu-phablet:DIRECTORY_OF_YOUR_CHOICE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you only have to extract the archive wherever you want the new directory &amp;quot;jessie&amp;quot; to reside. Without what's expained in section 4), this will only work on your internal storage.  Then, you only have to go into your chroot and finish the installation process. So do on the phone (the first command is needed since the terminal app is somehow restricted to execute binaries):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh localhost&lt;br /&gt;
tar -xvzf jessie.tar.gz&lt;br /&gt;
sudo chroot jessie /bin/bash&lt;br /&gt;
/debootstrap/debootstrap --second-stage&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to chroot into your new system using the third of the above commands.&lt;br /&gt;
&lt;br /&gt;
4) Using an image file&lt;br /&gt;
&lt;br /&gt;
First, create an image file on the system on which you execute the first debootstrap command. To create an 1GB image, do&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=IMAGE.img bs=1G count=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the B in GB is left out. &amp;quot;if&amp;quot; stands for &amp;quot;input file&amp;quot;, &amp;quot;of&amp;quot; for &amp;quot;output file&amp;quot; and &amp;quot;bs&amp;quot; for &amp;quot;block size&amp;quot;. There are more efficient commands out there, but those only work on certain types of file systems, AFAIK. This one also works on an SD-card or a tempfs. Please note the use of /dev/zero and not /dev/random or /dev/urandom as that would take a lot longer and make it take a lot longer to transfer the image between devices.&lt;br /&gt;
&lt;br /&gt;
Mount the image file to a loop-device and create a file system on it.  Without a file system, you cannot yet mount the image to a directory, only to a block-device. So do &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup -f&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and remember the output. Replace every &amp;quot;LOOP&amp;quot; in the following commands by the output of the above command. First, assign the image to a block device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo losetup LOOP IMAGE.img&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the file system on it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mkfs -t ext4 LOOP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, detach the image from the loop device:&lt;br /&gt;
&lt;br /&gt;
sudo losetup -d LOOP&lt;br /&gt;
&lt;br /&gt;
If you get command not found errors, just install the missing programmes. Now, create the directory and mount the image file to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir jessie&lt;br /&gt;
sudo mount -o loop IMAGE.img $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;quot;pwd&amp;quot; will make sure you give mount an absolute path to your current working directory. Now, use the directory &amp;quot;jessie&amp;quot; with debootstrap as explained above (the command including the --foreign flag). After you're finished, umount the image via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo umount $(pwd)/jessie&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and create an archive of the image file (will compress all the zeroes in the archive to almost nothing) and transfer that to your phone. Both SD-card and internal storage are fine. On your phone, create the directory &amp;quot;jessie&amp;quot; somewhere on the internal storage, mount the image to it and perform the second stage.&lt;br /&gt;
&lt;br /&gt;
You should now have a nice chroot on your phone that does not waste internal storage space.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=47</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=47"/>
		<updated>2015-08-28T12:57:33Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki has been created to document things you can do with the command line on an Ubuntu Phone.&lt;br /&gt;
&lt;br /&gt;
People with accounts with administrator permissions can [https://ubuntu-phone.host1.webarch.net/w/index.php?title=Special:UserLogin/signup create accounts for other people].&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&lt;br /&gt;
# [[SSH access through Wifi]] &amp;amp;mdash; How to get SSH access to the Ubuntu Phone via Wifi&lt;br /&gt;
# [[USB networking ]] &amp;amp;mdash; How to get SSH access through USB networking&lt;br /&gt;
# [[Install Packages]] &amp;amp;mdash; make the filesystem read-write and install additional &amp;lt;code&amp;gt;.deb&amp;lt;/code&amp;gt; packages&lt;br /&gt;
# [[Find Phone]] &amp;amp;mdash; this is a script to find your phone on the local network by it's Mac address&lt;br /&gt;
# [[Encrypted Home]] &amp;amp;mdash; add an additional account and create an encrypted home directory for it&lt;br /&gt;
# [[Proxy Web Traffic]] &amp;amp;mdash; install privoxy to filter out adverts and optionally forward web traffic to a ssh tunnel&lt;br /&gt;
# [[Debian Chroot]] &amp;amp;mdash; install a Debian system on an Ubuntu Phone&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a test of the syntax highlighting&lt;br /&gt;
echo &amp;quot;hello world!&amp;quot; | sed 's/world/Ubuntu phone/'&lt;br /&gt;
hello Ubuntu phone!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=46</id>
		<title>Proxy Web Traffic</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=46"/>
		<updated>2015-08-27T17:25:26Z</updated>

		<summary type="html">&lt;p&gt;Chris: /* SSH tunnel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow [[Install Packages]] to install &amp;lt;code&amp;gt;privoxy&amp;lt;/code&amp;gt;, then start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install privoxy&lt;br /&gt;
service privoxy start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp_proxy=http://localhost:8118/&lt;br /&gt;
http_proxy=http://localhost:8118/&lt;br /&gt;
https_proxy=http://localhost:8118/&lt;br /&gt;
FTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTPS_PROXY=http://localhost:8118/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot the phone to change the root filesystem to read-only and to ensure that sessions have the env vars above set (you can check in a terminal with &amp;lt;code&amp;gt;printenv&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Visit http://config.privoxy.org/ to test it is working.&lt;br /&gt;
&lt;br /&gt;
== SSH tunnel ==&lt;br /&gt;
&lt;br /&gt;
Set the root file system to be read-write and edit &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt; adding this line with the port the ssh tunnel will be on, in this case 3128:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward-socks5   /               127.0.0.1:3128 .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a list of local networks you don't want the tunnel to be used for (so you can use the web browser to login to public wifi networks for example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward         192.168.*.*/     .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a script to start a ssh tunnel, eg &amp;lt;code&amp;gt;~/bin/proxy&amp;lt;/code&amp;gt; containing something like this (remove the &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; for non-verbose output in the terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  REMOTE_SERVER=$1&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Run this script like this:&amp;quot;&lt;br /&gt;
  echo &amp;quot;/bin/bash $0 server-name-from-ssh-config-file&amp;quot;&lt;br /&gt;
  exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
ssh -vTnN -C -F &amp;quot;$HOME/.ssh/config&amp;quot; -D 3128 $REMOTE_SERVER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This works best if you have short names for servers in your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; and have ssh keys set up. &lt;br /&gt;
&lt;br /&gt;
Start the tunnel (note you might need to run it as follows unless you ssh to localhost first and have &amp;lt;code&amp;gt;~/bin/&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;, then you can simply type &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt; after you &amp;lt;code&amp;gt;chmod 750 ~/bin/proxy&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
bash ~/bin/proxy your-ssh-server&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Visit a page that reports your IP address, eg https://parrot.transitionnetwork.org/myip.shtml&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If your network is very unreliable, try adding this to &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
keep-alive-timeout 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=45</id>
		<title>Proxy Web Traffic</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=45"/>
		<updated>2015-08-27T17:25:02Z</updated>

		<summary type="html">&lt;p&gt;Chris: /* SSH tunnel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow [[Install Packages]] to install &amp;lt;code&amp;gt;privoxy&amp;lt;/code&amp;gt;, then start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install privoxy&lt;br /&gt;
service privoxy start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp_proxy=http://localhost:8118/&lt;br /&gt;
http_proxy=http://localhost:8118/&lt;br /&gt;
https_proxy=http://localhost:8118/&lt;br /&gt;
FTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTPS_PROXY=http://localhost:8118/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot the phone to change the root filesystem to read-only and to ensure that sessions have the env vars above set (you can check in a terminal with &amp;lt;code&amp;gt;printenv&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Visit http://config.privoxy.org/ to test it is working.&lt;br /&gt;
&lt;br /&gt;
== SSH tunnel ==&lt;br /&gt;
&lt;br /&gt;
Set the root file system to be read-write and edit &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt; adding this line with the port the ssh tunnel will be on, in this case 3128:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward-socks5   /               127.0.0.1:3128 .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a list of local networks you don't want the tunnel to be used for (so you can use the web browser to login to public wifi networks for example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward         192.168.*.*/     .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a script to start a ssh tunnel, eg &amp;lt;code&amp;gt;~/bin/proxy&amp;lt;/code&amp;gt; containing something like this (remove the &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; for non-verbose output in the terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  REMOTE_SERVER=$1&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Run this script like this:&amp;quot;&lt;br /&gt;
  echo &amp;quot;/bin/bash $0 server-name-from-ssh-config-file&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
ssh -vTnN -C -F &amp;quot;$HOME/.ssh/config&amp;quot; -D 3128 $REMOTE_SERVER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This works best if you have short names for servers in your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; and have ssh keys set up. &lt;br /&gt;
&lt;br /&gt;
Start the tunnel (note you might need to run it as follows unless you ssh to localhost first and have &amp;lt;code&amp;gt;~/bin/&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;, then you can simply type &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt; after you &amp;lt;code&amp;gt;chmod 750 ~/bin/proxy&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
bash ~/bin/proxy your-ssh-server&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Visit a page that reports your IP address, eg https://parrot.transitionnetwork.org/myip.shtml&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If your network is very unreliable, try adding this to &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
keep-alive-timeout 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=44</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=44"/>
		<updated>2015-08-27T17:18:08Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root file system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As root update the package list and install some additional packages (you can use &amp;lt;code&amp;gt;apt-cache search&amp;lt;/code&amp;gt; to find packages):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install cryptsetup git vim lynx screen subversion \&lt;br /&gt;
                iptables-persistent whois nmap arp-scan mosh \&lt;br /&gt;
                dnsutils wget privoxy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note it is important not to do &amp;lt;code&amp;gt;apt-get upgrade&amp;lt;/code&amp;gt; as this could break things.'''&lt;br /&gt;
&lt;br /&gt;
To return the phone root file system to being read-only you probably need to reboot the phone.&lt;br /&gt;
&lt;br /&gt;
After the phone system has been upgraded using the GUI you will need to repeat the steps above, so to make this easier you can put the above into a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Mount the root file system read-write&lt;br /&gt;
alias mnt-root-rw='sudo mount -o rw,remount /'&lt;br /&gt;
&lt;br /&gt;
# Install some extra packages and set vim as the&lt;br /&gt;
# default editor (edit this list as you wish)&lt;br /&gt;
alias apt-install-essential='sudo apt-get update ; sudo apt-get install cryptsetup git vim lynx screen subversion iptables-persistent whois nmap arp-scan mosh dnsutils wget;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then after upgrading you can simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mnt-root-rw&lt;br /&gt;
apt-install-essential&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after creating a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; you need to source it before the aliases will work (or open a new terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ~/.bash_aliases&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=43</id>
		<title>Proxy Web Traffic</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=43"/>
		<updated>2015-08-27T17:17:15Z</updated>

		<summary type="html">&lt;p&gt;Chris: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow [[Install Packages]] to install &amp;lt;code&amp;gt;privoxy&amp;lt;/code&amp;gt;, then start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install privoxy&lt;br /&gt;
service privoxy start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp_proxy=http://localhost:8118/&lt;br /&gt;
http_proxy=http://localhost:8118/&lt;br /&gt;
https_proxy=http://localhost:8118/&lt;br /&gt;
FTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTPS_PROXY=http://localhost:8118/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot the phone to change the root filesystem to read-only and to ensure that sessions have the env vars above set (you can check in a terminal with &amp;lt;code&amp;gt;printenv&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Visit http://config.privoxy.org/ to test it is working.&lt;br /&gt;
&lt;br /&gt;
== SSH tunnel ==&lt;br /&gt;
&lt;br /&gt;
Set the root file system to be read-write and edit &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt; adding this line with the port the ssh tunnel will be on, in this case 3128:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward-socks5   /               127.0.0.1:3128 .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a list of local networks you don't want the tunnel to be used for (so you can use the web browser to login to public wifi networks for example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward         192.168.*.*/     .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a script to start a ssh tunnel, eg &amp;lt;code&amp;gt;~/bin/proxy&amp;lt;/code&amp;gt; containing something like this (remove the &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; for non-verbose output in the terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  REMOTE_SERVER=$1&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Run this script like this:&amp;quot;&lt;br /&gt;
  echo &amp;quot;$0 server-name-from-ssh-config-file&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
ssh -vTnN -C -F &amp;quot;$HOME/.ssh/config&amp;quot; -D 3128 $REMOTE_SERVER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This works best if you have short names for servers in your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; and have ssh keys set up. &lt;br /&gt;
&lt;br /&gt;
Start the tunnel (note you might need to run it as follows unless you ssh to localhost first and have &amp;lt;code&amp;gt;~/bin/&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;, then you can simply type &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt; after you &amp;lt;code&amp;gt;chmod 750 ~/bin/proxy&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
bash ~/bin/proxy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Visit a page that reports your IP address, eg https://parrot.transitionnetwork.org/myip.shtml&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If your network is very unreliable, try adding this to &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
keep-alive-timeout 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=42</id>
		<title>Proxy Web Traffic</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=42"/>
		<updated>2015-08-27T17:16:51Z</updated>

		<summary type="html">&lt;p&gt;Chris: /* SSH tunnel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow [[Install Packages]] to install &amp;lt;code&amp;gt;privoxy&amp;lt;/code&amp;gt;, then start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install privoxy&lt;br /&gt;
service privoxy start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp_proxy=http://localhost:8118/&lt;br /&gt;
http_proxy=http://localhost:8118/&lt;br /&gt;
https_proxy=http://localhost:8118/&lt;br /&gt;
FTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTPS_PROXY=http://localhost:8118/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot the phone to change the root filesystem to read-only and to ensure that sessions have the env vars above set (you can check in a terminal with &amp;lt;code&amp;gt;printenv&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Visit http://config.privoxy.org/ to test it is working.&lt;br /&gt;
&lt;br /&gt;
== SSH tunnel ==&lt;br /&gt;
&lt;br /&gt;
Set the root file system to be read-write and edit &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt; adding this line with the port the ssh tunnel will be on, in this case 3128:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward-socks5   /               127.0.0.1:3128 .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a list of local networks you don't want the tunnel to be used for (so you can use the web browser to login to public wifi networks for example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward         192.168.*.*/     .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a script to start a ssh tunnel, eg &amp;lt;code&amp;gt;~/bin/proxy&amp;lt;/code&amp;gt; containing something like this (remove the &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; for non-verbose output in the terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  REMOTE_SERVER=$1&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Run this script like this:&amp;quot;&lt;br /&gt;
  echo &amp;quot;$0 server-name-from-ssh-config-file&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
ssh -vTnN -C -F &amp;quot;$HOME/.ssh/config&amp;quot; -D 3128 $REMOTE_SERVER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This works best if you have short names for servers in your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; and have ssh keys set up. &lt;br /&gt;
&lt;br /&gt;
Start the tunnel (note you might need to run it as follows unless you ssh to localhost first and have &amp;lt;code&amp;gt;~/bin/&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;, then you can simply type &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt; after you &amp;lt;code&amp;gt;chmod 750 ~/bin/proxy&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
bash ~/bin/proxy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Visit a page that reports your IP address, eg https://parrot.transitionnetwork.org/myip.shtml&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If your network is very unreliable, try adding this to &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{{{&lt;br /&gt;
keep-alive-timeout 300&lt;br /&gt;
}}}&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=41</id>
		<title>Proxy Web Traffic</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=41"/>
		<updated>2015-08-27T17:15:10Z</updated>

		<summary type="html">&lt;p&gt;Chris: /* SSH tunnel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow [[Install Packages]] to install &amp;lt;code&amp;gt;privoxy&amp;lt;/code&amp;gt;, then start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install privoxy&lt;br /&gt;
service privoxy start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp_proxy=http://localhost:8118/&lt;br /&gt;
http_proxy=http://localhost:8118/&lt;br /&gt;
https_proxy=http://localhost:8118/&lt;br /&gt;
FTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTPS_PROXY=http://localhost:8118/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot the phone to change the root filesystem to read-only and to ensure that sessions have the env vars above set (you can check in a terminal with &amp;lt;code&amp;gt;printenv&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Visit http://config.privoxy.org/ to test it is working.&lt;br /&gt;
&lt;br /&gt;
== SSH tunnel ==&lt;br /&gt;
&lt;br /&gt;
Set the root file system to be read-write and edit &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt; adding this line with the port the ssh tunnel will be on, in this case 3128:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward-socks5   /               127.0.0.1:3128 .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a list of local networks you don't want the tunnel to be used for (so you can use the web browser to login to public wifi networks for example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward         192.168.*.*/     .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a script to start a ssh tunnel, eg &amp;lt;code&amp;gt;~/bin/proxy&amp;lt;/code&amp;gt; containing something like this (remove the &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; for non-verbose output in the terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  REMOTE_SERVER=$1&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Run this script like this:&amp;quot;&lt;br /&gt;
  echo &amp;quot;$0 server-name-from-ssh-config-file&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
ssh -vTnN -C -F &amp;quot;$HOME/.ssh/config&amp;quot; -D 3128 $REMOTE_SERVER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This works best if you have short names for servers in your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; and have ssh keys set up. &lt;br /&gt;
&lt;br /&gt;
Start the tunnel (note you might need to run it as follows unless you ssh to localhost first and have &amp;lt;code&amp;gt;~/bin/&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;, then you can simply type &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt; after you &amp;lt;code&amp;gt;chmod 750 ~/bin/proxy&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
bash ~/bin/proxy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Visit a page that reports your IP address, eg https://parrot.transitionnetwork.org/myip.shtml&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If your network is very unreliable, try adding this to &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{{{&lt;br /&gt;
keep-alive-timeout 300&lt;br /&gt;
}}}&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=40</id>
		<title>Proxy Web Traffic</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=40"/>
		<updated>2015-08-27T17:13:42Z</updated>

		<summary type="html">&lt;p&gt;Chris: /* SSH tunnel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow [[Install Packages]] to install &amp;lt;code&amp;gt;privoxy&amp;lt;/code&amp;gt;, then start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install privoxy&lt;br /&gt;
service privoxy start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp_proxy=http://localhost:8118/&lt;br /&gt;
http_proxy=http://localhost:8118/&lt;br /&gt;
https_proxy=http://localhost:8118/&lt;br /&gt;
FTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTPS_PROXY=http://localhost:8118/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot the phone to change the root filesystem to read-only and to ensure that sessions have the env vars above set (you can check in a terminal with &amp;lt;code&amp;gt;printenv&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Visit http://config.privoxy.org/ to test it is working.&lt;br /&gt;
&lt;br /&gt;
== SSH tunnel ==&lt;br /&gt;
&lt;br /&gt;
Set the root file system to be read-write and edit &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt; adding this line with the port the ssh tunnel will be on, in this case 3128:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward-socks5   /               127.0.0.1:3128 .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a list of local networks you don't want the tunnel to be used for (so you can use the web browser to login to public wifi networks for example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward         192.168.*.*/     .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a script to start a ssh tunnel, eg &amp;lt;code&amp;gt;~/bin/proxy&amp;lt;/code&amp;gt; containing something like this (remove the &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; for non-verbose output in the terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  REMOTE_SERVER=$1&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Run this script like this:&amp;quot;&lt;br /&gt;
  echo &amp;quot;$0 server-name-from-ssh-config-file&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
ssh -vTnN -C -F &amp;quot;$HOME/.ssh/config&amp;quot; -D 3128 $REMOTE_SERVER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This works best if you have short names for servers in your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; and have ssh keys set up. &lt;br /&gt;
&lt;br /&gt;
Start the tunnel (note you might need to run it as follows unless you ssh to localhost first and have &amp;lt;code&amp;gt;~/bin/&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;, then you can simply type &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
bash ~/bin/proxy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Visit a page that reports your IP address, eg https://parrot.transitionnetwork.org/myip.shtml&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If your network is very unreliable, try adding this to &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{{{&lt;br /&gt;
keep-alive-timeout 300&lt;br /&gt;
}}}&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=39</id>
		<title>Proxy Web Traffic</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Proxy_Web_Traffic&amp;diff=39"/>
		<updated>2015-08-27T17:12:56Z</updated>

		<summary type="html">&lt;p&gt;Chris: Page created&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow [[Install Packages]] to install &amp;lt;code&amp;gt;privoxy&amp;lt;/code&amp;gt;, then start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install privoxy&lt;br /&gt;
service privoxy start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ftp_proxy=http://localhost:8118/&lt;br /&gt;
http_proxy=http://localhost:8118/&lt;br /&gt;
https_proxy=http://localhost:8118/&lt;br /&gt;
FTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTP_PROXY=http://localhost:8118/&lt;br /&gt;
HTTPS_PROXY=http://localhost:8118/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot the phone to change the root filesystem to read-only and to ensure that sessions have the env vars above set (you can check in a terminal with &amp;lt;code&amp;gt;printenv&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Visit http://config.privoxy.org/ to test it is working.&lt;br /&gt;
&lt;br /&gt;
== SSH tunnel ==&lt;br /&gt;
&lt;br /&gt;
Set the root file system to be read-writ and edit &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt; adding this line with the port the ssh tunnel will be on, in this case 3128:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward-socks5   /               127.0.0.1:3128 .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a list of local networks you don't want the tunnel to be used for (so you can use the web browser to login to public wifi networks for example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
forward         192.168.*.*/     .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a script to start a ssh tunnel, eg &amp;lt;code&amp;gt;~/bin/proxy&amp;lt;/code&amp;gt; containing something like this (remove the &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; for non-verbose output in the terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  REMOTE_SERVER=$1&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Run this script like this:&amp;quot;&lt;br /&gt;
  echo &amp;quot;$0 server-name-from-ssh-config-file&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
ssh -vTnN -C -F &amp;quot;$HOME/.ssh/config&amp;quot; -D 3128 $REMOTE_SERVER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This works best if you have short names for servers in your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; and have ssh keys set up. &lt;br /&gt;
&lt;br /&gt;
Start the tunnel (note you might need to run it as follows unless you ssh to localhost first and have &amp;lt;code&amp;gt;~/bin/&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt;, then you can simply type &amp;lt;code&amp;gt;proxy&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
bash ~/bin/proxy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Visit a page that reports your IP address, eg https://parrot.transitionnetwork.org/myip.shtml&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If your network is very unreliable, try adding this to &amp;lt;code&amp;gt;/etc/privoxy/config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{{{&lt;br /&gt;
keep-alive-timeout 300&lt;br /&gt;
}}}&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=38</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=38"/>
		<updated>2015-08-27T16:44:20Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki has been created to document things you can do with the command line on an Ubuntu Phone.&lt;br /&gt;
&lt;br /&gt;
People with accounts with administrator permissions can [https://ubuntu-phone.host1.webarch.net/w/index.php?title=Special:UserLogin/signup create accounts for other people].&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&lt;br /&gt;
# [[SSH access through Wifi]] &amp;amp;mdash; How to get SSH access to the Ubuntu Phone via Wifi&lt;br /&gt;
# [[USB networking ]] &amp;amp;mdash; How to get SSH access through USB networking&lt;br /&gt;
# [[Install Packages]] &amp;amp;mdash; make the filesystem read-write and install additional &amp;lt;code&amp;gt;.deb&amp;lt;/code&amp;gt; packages&lt;br /&gt;
# [[Find Phone]] &amp;amp;mdash; this is a script to find your phone on the local network by it's Mac address&lt;br /&gt;
# [[Encrypted Home]] &amp;amp;mdash; add an additional account and create an encrypted home directory for it&lt;br /&gt;
# [[Proxy Web Traffic]] &amp;amp;mdash; install privoxy to filter out adverts and optionally forward web traffic to a ssh tunnel&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a test of the syntax highlighting&lt;br /&gt;
echo &amp;quot;hello world!&amp;quot; | sed 's/world/Ubuntu phone/'&lt;br /&gt;
hello Ubuntu phone!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=37</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=37"/>
		<updated>2015-05-02T15:38:40Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root file system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As root update the package list and install some additional packages (you can use &amp;lt;code&amp;gt;apt-cache search&amp;lt;/code&amp;gt; to find packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install cryptsetup git vim lynx screen subversion \&lt;br /&gt;
                iptables-persistent whois nmap arp-scan mosh \&lt;br /&gt;
                dnsutils wget&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note it is important not to do &amp;lt;code&amp;gt;apt-get upgrade&amp;lt;/code&amp;gt; as this could break things.'''&lt;br /&gt;
&lt;br /&gt;
To return the phone root file system to being read-only you probably need to reboot the phone.&lt;br /&gt;
&lt;br /&gt;
After the phone system has been upgraded using the GUI you will need to repeat the steps above, so to make this easier you can put the above into a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Mount the root file system read-write&lt;br /&gt;
alias mnt-root-rw='sudo mount -o rw,remount /'&lt;br /&gt;
&lt;br /&gt;
# Install some extra packages and set vim as the&lt;br /&gt;
# default editor (edit this list as you wish)&lt;br /&gt;
alias apt-install-essential='sudo apt-get update ; sudo apt-get install cryptsetup git vim lynx screen subversion iptables-persistent whois nmap arp-scan mosh dnsutils wget;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then after upgrading you can simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mnt-root-rw&lt;br /&gt;
apt-install-essential&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after creating a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; you need to source it before the aliases will work (or open a new terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ~/.bash_aliases&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=33</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=33"/>
		<updated>2015-04-18T08:38:20Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root file system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ sudo -i&lt;br /&gt;
# mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As root update the package list and install some additional packages (you can use &amp;lt;code&amp;gt;apt-cache search&amp;lt;/code&amp;gt; to find packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install cryptsetup git vim lynx screen subversion \&lt;br /&gt;
                iptables-persistent whois nmap arp-scan mosh \&lt;br /&gt;
                dnsutils wget&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note it is important not to do &amp;lt;code&amp;gt;apt-get upgrade&amp;lt;/code&amp;gt; as this could break things.'''&lt;br /&gt;
&lt;br /&gt;
To return the phone root file system to being read-only you probably need to reboot the phone.&lt;br /&gt;
&lt;br /&gt;
After the phone system has been upgraded using the GUI you will need to repeat the steps above, so to make this easier you can put the above into a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Mount the root file system read-write&lt;br /&gt;
alias mnt-root-rw='sudo mount -o rw,remount /'&lt;br /&gt;
&lt;br /&gt;
# Install some extra packages and set vim as the&lt;br /&gt;
# default editor (edit this list as you wish)&lt;br /&gt;
alias apt-install-essential='sudo apt-get update ; sudo apt-get install cryptsetup git vim lynx screen subversion iptables-persistent whois nmap arp-scan mosh dnsutils wget;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then after upgrading you can simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mnt-root-rw&lt;br /&gt;
apt-install-essential&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after creating a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; you need to source it before the aliases will work (or open a new terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ~/.bash_aliases&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=32</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=32"/>
		<updated>2015-04-18T08:36:44Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root file system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ sudo -i&lt;br /&gt;
# mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As root update the package list and install some additional packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install cryptsetup git vim lynx screen subversion \&lt;br /&gt;
                iptables-persistent whois nmap arp-scan mosh \&lt;br /&gt;
                dnsutils wget&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note it is important not to do &amp;lt;code&amp;gt;apt-get upgrade&amp;lt;/code&amp;gt; as this could break things.'''&lt;br /&gt;
&lt;br /&gt;
To return the phone root file system to being read-only you probably need to reboot the phone.&lt;br /&gt;
&lt;br /&gt;
After the phone system has been upgraded using the GUI you will need to repeat the steps above, so to make this easier you can put the above into a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Mount the root file system read-write&lt;br /&gt;
alias mnt-root-rw='sudo mount -o rw,remount /'&lt;br /&gt;
&lt;br /&gt;
# Install some extra packages and set vim as the&lt;br /&gt;
# default editor (edit this list as you wish)&lt;br /&gt;
alias apt-install-essential='sudo apt-get update ; sudo apt-get install cryptsetup git vim lynx screen subversion iptables-persistent whois nmap arp-scan mosh dnsutils wget;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then after upgrading you can simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mnt-root-rw&lt;br /&gt;
apt-install-essential&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after creating a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; you need to source it before the aliases will work (or open a new terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ~/.bash_aliases&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Category:SSH&amp;diff=31</id>
		<title>Category:SSH</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Category:SSH&amp;diff=31"/>
		<updated>2015-04-18T08:07:42Z</updated>

		<summary type="html">&lt;p&gt;Chris: Created page with &amp;quot;Pages related to configuring and using the secure shell (SSH) on the Ubuntu Phone.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pages related to configuring and using the secure shell (SSH) on the Ubuntu Phone.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=30</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=30"/>
		<updated>2015-04-18T08:00:12Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root files system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ sudo -i&lt;br /&gt;
# mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As root update the package list and install some additional packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install cryptsetup git vim lynx screen subversion \&lt;br /&gt;
                iptables-persistent whois nmap arp-scan mosh \&lt;br /&gt;
                dnsutils wget&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note it is important not to do &amp;lt;code&amp;gt;apt-get upgrade&amp;lt;/code&amp;gt; as this could break things.'''&lt;br /&gt;
&lt;br /&gt;
To return the phone root file system to being read-only you probably need to reboot the phone.&lt;br /&gt;
&lt;br /&gt;
After the phone system has been upgraded using the GUI you will need to repeat the steps above, so to make this easier you can put the above into a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Mount the root file system read-write&lt;br /&gt;
alias mnt-root-rw='sudo mount -o rw,remount /'&lt;br /&gt;
&lt;br /&gt;
# Install some extra packages and set vim as the&lt;br /&gt;
# default editor (edit this list as you wish)&lt;br /&gt;
alias apt-install-essential='sudo apt-get update ; sudo apt-get install cryptsetup git vim lynx screen subversion iptables-persistent whois nmap arp-scan mosh dnsutils wget;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then after upgrading you can simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mnt-root-rw&lt;br /&gt;
apt-install-essential&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after creating a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; you need to source it before the aliases will work (or open a new terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ~/.bash_aliases&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Find_Phone&amp;diff=29</id>
		<title>Find Phone</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Find_Phone&amp;diff=29"/>
		<updated>2015-04-18T07:59:22Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you want to ssh into your phone and you don't know it's IP address you can use this script to find it, note that you need to set a couple of environmental variables first and also you need to supply the subnet (automating this would be an improvement):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# This is a script to find a device on a LAN by it's Mac address&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  SUBNET=$1&lt;br /&gt;
else&lt;br /&gt;
  /sbin/ifconfig&lt;br /&gt;
  echo &amp;quot;Please supply the subnet, eg: $0 192.168.0.0/24&amp;quot;&lt;br /&gt;
  exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ $PHONE_MAC ]]; then&lt;br /&gt;
  echo Mac:   $PHONE_MAC &lt;br /&gt;
else&lt;br /&gt;
  echo You need to set the PHONE_MAC environmental variable to &lt;br /&gt;
  echo the Mac address of your phone, eg add the following to &lt;br /&gt;
  echo your ~/.bashrc:&lt;br /&gt;
  echo&lt;br /&gt;
  echo export PHONE_MAC=&amp;quot;10:10:10:10:10:10&amp;quot;&lt;br /&gt;
  exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ $PHONE_IFACE ]]; then&lt;br /&gt;
  echo Iface: $PHONE_IFACE &lt;br /&gt;
else&lt;br /&gt;
  echo You need to set the PHONE_IFACE environmental variable to &lt;br /&gt;
  echo the network interface the phone can be reached on, eg add &lt;br /&gt;
  echo the following to your ~/.bashrc:&lt;br /&gt;
  echo&lt;br /&gt;
  echo export PHONE_IFACE=&amp;quot;wlan0&amp;quot;&lt;br /&gt;
  exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Nmap and arp scan the network&lt;br /&gt;
sudo nmap -sP $SUBNET &amp;gt; /dev/null&lt;br /&gt;
PHONE_IP=$(sudo arp-scan -I $PHONE_IFACE $SUBNET | grep $PHONE_MAC | awk '{print $1}')&lt;br /&gt;
&lt;br /&gt;
if [[ $PHONE_IP ]]; then&lt;br /&gt;
  echo IP:    $PHONE_IP &lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Sorry the phone couldn't be found&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripts]]&lt;br /&gt;
[[Category:SSH]]&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=SSH_access_through_Wifi&amp;diff=28</id>
		<title>SSH access through Wifi</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=SSH_access_through_Wifi&amp;diff=28"/>
		<updated>2015-04-18T07:58:49Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
How to get SSH access to the ubuntu-phone via Wifi:&lt;br /&gt;
&lt;br /&gt;
Login via terminal app, you will be user 'phablet' (the password is the unlock number).&lt;br /&gt;
&lt;br /&gt;
Enable SSH service with (remains after boot):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ android-gadget-service enable ssh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fetch your public key to the Phone from some place:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget http://www.from.your.site/id_rsa.pub&lt;br /&gt;
$ mkdir .ssh&lt;br /&gt;
$ chmod 0700 .ssh&lt;br /&gt;
$ mv id_rsa.pub .ssh/authorized_keys&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can look up your IP on the phone and use ssh to connect:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ ip addr show wlan0|grep inet&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from your workstation use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ ssh phablet@IP-addr-from-above-command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SSH-in is even possible when the device is locked and black; don't know&lt;br /&gt;
if this is intention that it does not suspend; the configuration goes like this&lt;br /&gt;
&lt;br /&gt;
See also: &lt;br /&gt;
&lt;br /&gt;
* [http://askubuntu.com/questions/348714/how-can-i-access-my-ubuntu-phone-over-ssh/599041#599041 http://askubuntu.com/questions/348714/how-can-i-access-my-ubuntu-phone-over-ssh/599041#599041]&lt;br /&gt;
* [[Find Phone]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:SSH]]&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=23</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=23"/>
		<updated>2015-04-17T20:44:34Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki has been created to document things you can do with the command line on an Ubuntu Phone.&lt;br /&gt;
&lt;br /&gt;
People with accounts with administrator permissions can [https://ubuntu-phone.host1.webarch.net/w/index.php?title=Special:UserLogin/signup create accounts for other people].&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&lt;br /&gt;
* [[Install Packages]] &amp;amp;mdash; make the filesystem read-write and install additional &amp;lt;code&amp;gt;.deb&amp;lt;/code&amp;gt; packages&lt;br /&gt;
* [[Find Phone]] &amp;amp;mdash; this is a script to find your phone on the local network by it's Mac address&lt;br /&gt;
* [[Encrypted Home]] &amp;amp;mdash; add an additional account and create an encrypted home directory for it&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a test of the syntax highlighting&lt;br /&gt;
echo &amp;quot;hello world!&amp;quot; | sed 's/world/Ubuntu phone/'&lt;br /&gt;
hello Ubuntu phone!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=22</id>
		<title>Encrypted Home</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=22"/>
		<updated>2015-04-17T20:41:48Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Create an encrypted /home/user/ directory, this needs some additional packages to be installed, see [[Install Packages]], set the wanted username as an environmental variable first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
export NEWUSER=&amp;quot;username&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a file to use as a disk (set the size as required, it is 1G in this example) and encrypt&lt;br /&gt;
and format it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fallocate -l 1G /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksFormat /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER&lt;br /&gt;
mkfs.ext4 /dev/mapper/$NEWUSER&lt;br /&gt;
mkdir /home/$NEWUSER&lt;br /&gt;
mount /dev/mapper/$NEWUSER /home/$NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new user and add them to the sudo group:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
adduser --disabled-password $NEWUSER&lt;br /&gt;
addgroup $NEWUSER&lt;br /&gt;
adduser $NEWUSER $NEWUSER&lt;br /&gt;
usermod -a -G sudo $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After doing the above you can su to the new user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And you now have a user account with an encrypted filesystem.&lt;br /&gt;
&lt;br /&gt;
You can add the following to /home/phablet/.bash_aliases for mounting&lt;br /&gt;
the disk in future (change $NEWUSER to your username first!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
alias mnt-$NEWUSER='sudo cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER; sudo e2fsck /dev/mapper/$NEWUSER ; sudo mount /dev/mapper/$NEWUSER /home/$NEWUSER'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=21</id>
		<title>Encrypted Home</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=21"/>
		<updated>2015-04-17T20:41:12Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Create an encrypted /home/user/ directory, this needs some additional packages to be installed, see [[Install Packages]], set the wanted username as an environmental variable first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
export NEWUSER=&amp;quot;username&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a file to use as a disk (set the size as required) and encrypt&lt;br /&gt;
and format it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fallocate -l 1G /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksFormat /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER&lt;br /&gt;
mkfs.ext4 /dev/mapper/$NEWUSER&lt;br /&gt;
mkdir /home/$NEWUSER&lt;br /&gt;
mount /dev/mapper/$NEWUSER /home/$NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new user and add them to the sudo group:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
adduser --disabled-password $NEWUSER&lt;br /&gt;
addgroup $NEWUSER&lt;br /&gt;
adduser $NEWUSER $NEWUSER&lt;br /&gt;
usermod -a -G sudo $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After doing the above you can su to the new user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And you now have a user account with an encrypted filesystem.&lt;br /&gt;
&lt;br /&gt;
You can add the following to /home/phablet/.bash_aliases for mounting&lt;br /&gt;
the disk in future (change $NEWUSER to your username first!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
alias mnt-$NEWUSER='sudo cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER; sudo e2fsck /dev/mapper/$NEWUSER ; sudo mount /dev/mapper/$NEWUSER /home/$NEWUSER'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=20</id>
		<title>Encrypted Home</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=20"/>
		<updated>2015-04-17T20:40:58Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Create an encrypted /home/user/ directory, this needs some additional packages to be installed, [[Install Packages]], set the wanted username as an environmental variable first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
export NEWUSER=&amp;quot;username&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a file to use as a disk (set the size as required) and encrypt&lt;br /&gt;
and format it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fallocate -l 1G /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksFormat /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER&lt;br /&gt;
mkfs.ext4 /dev/mapper/$NEWUSER&lt;br /&gt;
mkdir /home/$NEWUSER&lt;br /&gt;
mount /dev/mapper/$NEWUSER /home/$NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new user and add them to the sudo group:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
adduser --disabled-password $NEWUSER&lt;br /&gt;
addgroup $NEWUSER&lt;br /&gt;
adduser $NEWUSER $NEWUSER&lt;br /&gt;
usermod -a -G sudo $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After doing the above you can su to the new user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And you now have a user account with an encrypted filesystem.&lt;br /&gt;
&lt;br /&gt;
You can add the following to /home/phablet/.bash_aliases for mounting&lt;br /&gt;
the disk in future (change $NEWUSER to your username first!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
alias mnt-$NEWUSER='sudo cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER; sudo e2fsck /dev/mapper/$NEWUSER ; sudo mount /dev/mapper/$NEWUSER /home/$NEWUSER'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=19</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=19"/>
		<updated>2015-04-17T20:40:12Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root files system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As root update the package list and install some additional packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install cryptsetup git vim lynx screen subversion \&lt;br /&gt;
                iptables-persistent whois nmap arp-scan mosh \&lt;br /&gt;
                dnsutils wget&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note it is important not to do &amp;lt;code&amp;gt;apt-get upgrade&amp;lt;/code&amp;gt; as this could break things.'''&lt;br /&gt;
&lt;br /&gt;
To return the phone root file system to being read-only you probably need to reboot the phone.&lt;br /&gt;
&lt;br /&gt;
After the phone system has been upgraded using the GUI you will need to repeat the steps above, so to make this easier you can put the above into a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Mount the root file system read-write&lt;br /&gt;
alias mnt-root-rw='sudo mount -o rw,remount /'&lt;br /&gt;
&lt;br /&gt;
# Install some extra packages and set vim as the&lt;br /&gt;
# default editor (edit this list as you wish)&lt;br /&gt;
alias apt-install-essential='sudo apt-get update ; sudo apt-get install cryptsetup git vim lynx screen subversion iptables-persistent whois nmap arp-scan mosh dnsutils wget;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then after upgrading you can simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mnt-root-rw&lt;br /&gt;
apt-install-essential&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after creating a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; you need to source it before the aliases will work (or open a new terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ~/.bash_aliases&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=18</id>
		<title>Encrypted Home</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Encrypted_Home&amp;diff=18"/>
		<updated>2015-04-17T20:36:02Z</updated>

		<summary type="html">&lt;p&gt;Chris: Created page with &amp;quot;Create an encrypted /home/user/ directory, this needs some additional packages to be installed, see above, set the wanted username as an environmental variable first:  &amp;lt;syntax...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Create an encrypted /home/user/ directory, this needs some additional packages to be installed, see above, set the wanted username as an environmental variable first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
export NEWUSER=&amp;quot;username&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a file to use as a disk (set the size as required) and encrypt&lt;br /&gt;
and format it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fallocate -l 1G /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksFormat /home/$NEWUSER.img&lt;br /&gt;
cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER&lt;br /&gt;
mkfs.ext4 /dev/mapper/$NEWUSER&lt;br /&gt;
mkdir /home/$NEWUSER&lt;br /&gt;
mount /dev/mapper/$NEWUSER /home/$NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new user and add them to the sudo group:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
adduser --disabled-password $NEWUSER&lt;br /&gt;
addgroup $NEWUSER&lt;br /&gt;
adduser $NEWUSER $NEWUSER&lt;br /&gt;
usermod -a -G sudo $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After doing the above you can su to the new user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - $NEWUSER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And you now have a user account with an encrypted filesystem.&lt;br /&gt;
&lt;br /&gt;
You can add the following to /home/phablet/.bash_aliases for mounting&lt;br /&gt;
the disk in future (change $NEWUSER to your username first!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
alias mnt-$NEWUSER='sudo cryptsetup luksOpen /home/$NEWUSER.img $NEWUSER; sudo e2fsck /dev/mapper/$NEWUSER ; sudo mount /dev/mapper/$NEWUSER /home/$NEWUSER'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=17</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=17"/>
		<updated>2015-04-17T20:33:49Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root files system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As root update the package list and install some additional packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install cryptsetup git vim lynx screen subversion \&lt;br /&gt;
                iptables-persistent whois nmap arp-scan mosh \&lt;br /&gt;
                dnsutils wget&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note it is important not to do &amp;lt;code&amp;gt;apt-get upgrade&amp;lt;/code&amp;gt; as this could break things.'''&lt;br /&gt;
&lt;br /&gt;
To return the phone root file system to being read-only you probably need to reboot the phone.&lt;br /&gt;
&lt;br /&gt;
After the phone system has been upgraded using the GUI you will need to repeat the steps above, so to make this easier you can put the above into a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Mount the root file system read-write&lt;br /&gt;
alias mnt-root-rw='sudo mount -o rw,remount /'&lt;br /&gt;
&lt;br /&gt;
# Install some extra packages and set vim as the&lt;br /&gt;
# default editor (edit this list as you wish)&lt;br /&gt;
alias apt-install-essential='sudo apt-get update ; sudo apt-get install cryptsetup git vim lynx screen subversion iptables-persistent whois nmap arp-scan mosh dnsutils wget;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then after upgrading you can simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mnt-root-rw&lt;br /&gt;
apt-install-essential&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after creating a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; you need to source it before the aliases will work (or open a new terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ~/.bash_aliases&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
source&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=16</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=16"/>
		<updated>2015-04-17T20:32:23Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root files system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As root update the package list and install some additional packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install cryptsetup git vim lynx screen subversion \&lt;br /&gt;
                iptables-persistent whois nmap arp-scan mosh \&lt;br /&gt;
                dnsutils wget&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note it is important not to do &amp;lt;code&amp;gt;apt-get upgrade&amp;lt;/code&amp;gt; as this could break things.'''&lt;br /&gt;
&lt;br /&gt;
To return the phone root file system to being read-only you probably need to reboot the phone.&lt;br /&gt;
&lt;br /&gt;
After the phone system has been upgraded using the GUI you will need to repeat the steps above, so to make this easier you can put the above into a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Mount the root file system read-write&lt;br /&gt;
alias mnt-root-rw='sudo mount -o rw,remount /'&lt;br /&gt;
&lt;br /&gt;
# Install some extra packages and set vim as the&lt;br /&gt;
# default editor (edit this list as you wish)&lt;br /&gt;
alias apt-install-essential='sudo apt-get update ; sudo apt-get install cryptsetup git vim lynx screen subversion iptables-persistent whois nmap arp-scan mosh dnsutils wget;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after creating a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; you need to source it before the aliases will work (or open a new terminal):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ~/.bash_aliases&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
source&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=15</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=15"/>
		<updated>2015-04-17T20:31:02Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root files system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As root update the package list and install some additional packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install cryptsetup git vim lynx screen subversion \&lt;br /&gt;
                iptables-persistent whois nmap arp-scan mosh \&lt;br /&gt;
                dnsutils wget&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note it is important not to do &amp;lt;code&amp;gt;apt-get upgrade&amp;lt;/code&amp;gt; as this could break things.'''&lt;br /&gt;
&lt;br /&gt;
To return the phone root file system to being read-only you probably need to reboot the phone.&lt;br /&gt;
&lt;br /&gt;
After the phone system has been upgraded using the GUI you will need to repeat the steps above, so to make this easier you can put the above into a &amp;lt;code&amp;gt;~/.bash_aliases&amp;lt;/code&amp;gt; file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Mount the root file system read-write&lt;br /&gt;
alias mnt-root-rw='sudo mount -o rw,remount /'&lt;br /&gt;
&lt;br /&gt;
# Install some extra packages and set vim as the&lt;br /&gt;
# default editor (edit this list as you wish)&lt;br /&gt;
alias apt-install-essential='sudo apt-get update ; sudo apt-get install cryptsetup git vim lynx screen subversion iptables-persistent whois nmap arp-scan mosh dnsutils wget;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=14</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=14"/>
		<updated>2015-04-17T20:27:23Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root files system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As root update the package list and install some additional packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install cryptsetup git vim lynx screen subversion \&lt;br /&gt;
                iptables-persistent whois nmap arp-scan mosh \&lt;br /&gt;
                dnsutils wget&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note it is important not to do &amp;lt;code&amp;gt;apt-get upgrade&amp;lt;/code&amp;gt; as this could break things.'''&lt;br /&gt;
&lt;br /&gt;
To return the phone root file system to being read-only you probably need to reboot the phone.&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=13</id>
		<title>Install Packages</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Install_Packages&amp;diff=13"/>
		<updated>2015-04-17T20:22:57Z</updated>

		<summary type="html">&lt;p&gt;Chris: Created page with &amp;quot;Open the terminal client and sudo to root and then remount the root files system read-write:  &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; sudo -i mount -o rw,remount / &amp;lt;/syntaxhighlight&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open the terminal client and sudo to root and then remount the root files system read-write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -i&lt;br /&gt;
mount -o rw,remount /&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=12</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=12"/>
		<updated>2015-04-17T20:21:22Z</updated>

		<summary type="html">&lt;p&gt;Chris: /* Content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki has been created to document things you can do with the command line on an Ubuntu Phone.&lt;br /&gt;
&lt;br /&gt;
People with accounts with administrator permissions can [https://ubuntu-phone.host1.webarch.net/w/index.php?title=Special:UserLogin/signup create accounts for other people].&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&lt;br /&gt;
* [[Install Packages]] &amp;amp;mdash; make the filesystem read-write and install additional &amp;lt;code&amp;gt;.deb&amp;lt;/code&amp;gt; packages&lt;br /&gt;
* [[Find Phone]] &amp;amp;mdash; this is a script to find your phone on the local network by it's Mac address&lt;br /&gt;
* [[Encrypted Home]] &amp;amp;mdash; add an additional account and create an encrypted home directory for it&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a test of the syntax highlighting&lt;br /&gt;
echo &amp;quot;hello world!&amp;quot; | sed 's/world/Ubuntu phone/'&lt;br /&gt;
hello Ubuntu phone!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=11</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=11"/>
		<updated>2015-04-17T20:20:58Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki has been created to document things you can do with the command line on an Ubuntu Phone.&lt;br /&gt;
&lt;br /&gt;
People with accounts with administrator permissions can [https://ubuntu-phone.host1.webarch.net/w/index.php?title=Special:UserLogin/signup create accounts for other people].&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&lt;br /&gt;
* [[Install Packages]] &amp;amp;mdash; make the filesystem read-write and install additional `.deb` packages&lt;br /&gt;
* [[Find Phone]] &amp;amp;mdash; this is a script to find your phone on the local network by it's Mac address&lt;br /&gt;
* [[Encrypted Home]] &amp;amp;mdash; add an additional account and create an encrypted home directory for it&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a test of the syntax highlighting&lt;br /&gt;
echo &amp;quot;hello world!&amp;quot; | sed 's/world/Ubuntu phone/'&lt;br /&gt;
hello Ubuntu phone!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=10</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Main_Page&amp;diff=10"/>
		<updated>2015-04-17T20:19:53Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki has been created to document things you can do with the command line on an Ubuntu Phone.&lt;br /&gt;
&lt;br /&gt;
People with accounts with administrator permissions can [https://ubuntu-phone.host1.webarch.net/w/index.php?title=Special:UserLogin/signup create accounts for other people].&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&lt;br /&gt;
* [[Find Phone]] &amp;amp;mdash; this is a script to find your phone on the local network by it's Mac address&lt;br /&gt;
* [[Encrypted Home]] &amp;amp;mdash; add an additional account and create an encrypted home directory for it&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this is a test of the syntax highlighting&lt;br /&gt;
echo &amp;quot;hello world!&amp;quot; | sed 's/world/Ubuntu phone/'&lt;br /&gt;
hello Ubuntu phone!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
	<entry>
		<id>https://ubuntu.webarch.uk/w/index.php?title=Find_Phone&amp;diff=9</id>
		<title>Find Phone</title>
		<link rel="alternate" type="text/html" href="https://ubuntu.webarch.uk/w/index.php?title=Find_Phone&amp;diff=9"/>
		<updated>2015-04-17T20:17:52Z</updated>

		<summary type="html">&lt;p&gt;Chris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you want to ssh into your phone and you don't know it's IP address you can use this script to find it, note that you need to set a couple of environmental variables first and also you need to supply the subnet (automating this would be an improvement):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# This is a script to find a device on a LAN by it's Mac address&lt;br /&gt;
&lt;br /&gt;
if [[ $1 ]]; then&lt;br /&gt;
  SUBNET=$1&lt;br /&gt;
else&lt;br /&gt;
  /sbin/ifconfig&lt;br /&gt;
  echo &amp;quot;Please supply the subnet, eg: $0 192.168.0.0/24&amp;quot;&lt;br /&gt;
  exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ $PHONE_MAC ]]; then&lt;br /&gt;
  echo Mac:   $PHONE_MAC &lt;br /&gt;
else&lt;br /&gt;
  echo You need to set the PHONE_MAC environmental variable to &lt;br /&gt;
  echo the Mac address of your phone, eg add the following to &lt;br /&gt;
  echo your ~/.bashrc:&lt;br /&gt;
  echo&lt;br /&gt;
  echo export PHONE_MAC=&amp;quot;10:10:10:10:10:10&amp;quot;&lt;br /&gt;
  exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ $PHONE_IFACE ]]; then&lt;br /&gt;
  echo Iface: $PHONE_IFACE &lt;br /&gt;
else&lt;br /&gt;
  echo You need to set the PHONE_IFACE environmental variable to &lt;br /&gt;
  echo the network interface the phone can be reached on, eg add &lt;br /&gt;
  echo the following to your ~/.bashrc:&lt;br /&gt;
  echo&lt;br /&gt;
  echo export PHONE_IFACE=&amp;quot;wlan0&amp;quot;&lt;br /&gt;
  exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Nmap and arp scan the network&lt;br /&gt;
sudo nmap -sP $SUBNET &amp;gt; /dev/null&lt;br /&gt;
PHONE_IP=$(sudo arp-scan -I $PHONE_IFACE $SUBNET | grep $PHONE_MAC | awk '{print $1}')&lt;br /&gt;
&lt;br /&gt;
if [[ $PHONE_IP ]]; then&lt;br /&gt;
  echo IP:    $PHONE_IP &lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Sorry the phone couldn't be found&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripts]]&lt;/div&gt;</summary>
		<author><name>Chris</name></author>
	</entry>
</feed>