sábado, 11 de octubre de 2014

How to recover your ecryptfs home *the ultimate guide*

Hi, it's been a while.

As I told you a few weeks ago I changed my laptop and now I'm using a Mac, but that's not the point for today's post.

What I want to explain today is how to recover your data when you have removed the hard drive from your laptop and were using Ubuntu's ecryptfs .  You should know your login password at least. 

A good idea is to have your passphrase (the one which pops up after you've installed your Ubuntu, don't you remember???)




Ok, the process is simple, but you'll need an Ubuntu machine where to hook your drive.

Got it?

When you hook your drive it should be mounted like this:


/dev/sdc4 on /media/USERNAME/dae18b51-ec77-40bd-a735-6320415e561a type ext4 (rw,nosuid,nodev,uhelper=udisks2)

Probably you had a different username in your old laptop, if not just ignore this step.

sudo mkdir OLDUSERNAME
sudo chown USERNAME:USERNAME OLDUSERNAME

Now you should run 

sudo ecryptfs-recover-private /media/USERNAME/dae18b51-ec77-40bd-a735-6320415e561a/home/.ecryptfs/OLDUSERNAME/.Private

And it should go like this:


sudo ecryptfs-recover-private /media/USERNAME/dae18b51-ec77-40bd-a735-6320415e561a/home/.ecryptfs/OLDUSERNAME/.Private
[sudo] password for andres:
INFO: Found [/media/USERNAME/dae18b51-ec77-40bd-a735-6320415e561a/home/.ecryptfs/OLDUSERNAME/.Private].
Try to recover this directory? [Y/n]:
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n]
INFO: Enter your LOGIN passphrase...
Passphrase:
Inserted auth tok with sig [a97fa5251799a5c5] into the user session keyring
INFO: Success!  Private data mounted at [/tmp/ecryptfs.KB1kDsq1].

So, if you do know your old LOGIN password, there shouldn't be any trouble at all :)

BUT if you don't remember it, just answer N to the LOGIN passphrase question and be prepared to type the 32 characters that Ubuntu showed when you first install it (you kept it, don't you?)

Finally, you can check your data unencrypted at the /tmp/ecryptfs.XXXXX directory.


Best regards,

Andrés

sábado, 2 de agosto de 2014

Changing my laptop after 6 years with it.

About 3 weeks ago I bought a new laptop.  I had the intention to buy a Lenovo X1 Carbon but it was impossible as Lenovo simply wouldn't let me to do it.  They claimed it'd take about 6 weeks to fulfill the order.  I hadn't that much time for other reasons I'll talk about later.



My previous laptop, and I'm talking about both the work and home ones, it's around 6 years old.  Huge time in terms of technology, but I'm a Linux user, and that my friends it's the difference between earth and heaven because despite the slowness with latest Ubuntu releases, it worked as I needed until recently, and that's why I needed to upgrade.

After reading a lot of reviews I found a consistently recommendation to buy a Mac Book Pro.  The Lenovo was in second place. After several years using Linux (since 2001) and before that Windows, I thought it was worth to try and use OSX for a change. I must confess that I've liked it.

It's double the specs of the Lenovo laptop I was looking for.  And the OS it's a Unix derivative called OSX Maverick (but you already know that, don't you?)

On a first basis, my idea was to install Ubuntu on it (and in fact I did) but I had to give it a try, so I explore a little bit the system and found things I liked a lot.  Multiple desktops as in Linux.  That was a major discovery.  Gestures, I liked them a lot.  And the usual Open Source software that I used on a daily basis such as Firefox, Chrome, Thunderbird, Libreoffice, Gimp, VirtualBox, among others. Also, there's tons of Open Source apps available too and that's great for someone like me who claims to bring OSS to companies for a living.

However it's absurd that I've got to download software from webpages in order to install them. Definitely repos, PPA, yum, apt-get and all of that infrastructure is amazing and one of the strongest differentiators of Linux.  No wonder why there's so many viruses for Windows and -apparently- for OSX, too.

I haven't finished the tuning, probably I'd hit some roadblocks here as it seems OSX likes to hide the granular control from their users.  Let's see.  Meanwhile, this has been an interesting change, it forces to renew myself and not to stay on the same comfortable world that I've been for all this years using Linux.

I've got to say that I installed Ubuntu in a 100G partition with all the intention to use it, but as soon as I found the virtual desktops (and that Linux didn't supported VGA and Network thunderbolt adapters) I decided to give OSX a real chance.


Hopefully I'd write about installing Ubuntu on the Mac and how to share mouse & keyboard using Synergy between OSX and Ubuntu, as I'm still using my old laptop :)

Después de 6 años cambie mi portátil.

Hola, 


Desde Julio 11 estoy estrenando portátil.  Mi intención inicial era comprarme un Lenovo X1 Carbon, pero por razones que desconozco, el modelo con las especificaciones que quería (Core i7, 8G y 256G SDD) tardaba 60 días para ser despachado tanto en Colombia como en Estados Unidos.



Mi portátil anterior lleva conmigo un poco más de 6 años.  Sí 6 años.  La razón es muy sencilla, soy usuario tiempo completo de Linux desde hace 13 años (2001).   Con Linux no sientes el desgaste de tu equipo.  O al menos durante una buena parte de ese tiempo, ya que en los últimos 2 años ya estaba quedándose corto a mis necesidades.

El cuento es que después de buscar y leer muchos artículos sobre cual portátil era el mejor, siempre había algo común en todos ellos.  Los mejores portátiles para un usuario como yo, eran los Mac Book Pro y en segundo lugar los Lenovo.

Después de tanto tiempo usando Linux (y antes de eso Windows), decidí que valía la pena lanzarme al ruedo y cambiar de Sistema Operativo.  En primera instancia la idea era conocerlo pero me he ido adaptando rápidamente y debo admitir que me ha gustado.

A nivel de especificaciones supera al doble las que me ofrecía Lenovo.  Y eso me gusta :)

A nivel de sistema operativo viene con un derivado del Unix, más conocido como OSX Maverick.  

Decidí seguir usando el OSX al descubrir que podía tener múltiples escritorios tal y como hago en Linux, que podía instalar el software que uso regularmente como Firefox, Chrome, Thunderbird, Libreoffice, Gimp, VirtualBox, entre otros.  Y algo que me gusto mucho es que, como es un derivado de Unix, una gran cantidad de aplicaciones Open Source están disponibles para OSX sin mucho esfuerzo.

Algo que aún no me gusta es el sistema de instalación de paquetes.  Volver a instalar software bajado de una página web después de haber disfrutado de las increíbles ventajas de los repos y PPA en Ubuntu y de YUM y APT-GET es bastante decepcionante. 

Todavía no he logrado afinarlo perfectamente, pero a medida que pase el tiempo y tenga la disponibilidad lo podré poner a punto.

Por lo pronto creo que ha sido un cambio bastante interesante.  Me obliga a renovarme y a no quedarme cómodo.

Inicialmente le instale Ubuntu en una partición de 100G y tenía toda la intención de usarlo con Ubuntu pero tuve dos razones para darle la oportunidad al OSX, la primera descubrir los escritorios, la segunda que el conector thunderbolt a VGA no funciona bajo Linux.  



Eventualmente hare un blog post sobre la instalación de Ubuntu en mi Mac y sobre como compartir el mouse y el teclado usando Synergy entre OSX Maverick y Ubuntu Linux.


sábado, 14 de diciembre de 2013

Como instalar spice-xpi en Ubuntu

Este post está dirigido a aquellos que saben que es spice-xpi y que utilizan una distribución basada en Debian como Ubuntu.


Spice es el protocolo de acceso remoto que compró Red Hat como parte de la adquisición de Qumranet en el 2008.   Este protocolo tiene muy buenas ventajas frente a otros protocolos existentes en el mercado, sin embargo y debido a la baja tajada del mercado de virtualización que tiene Red Hat es muy poco conocido incluso para aquellos que están en el medio especializado.

Afortunadamente Red Hat Enterprise Virtualization RHEV está logrando cierta penetración en el mercado y está comenzando a ganar cierto interés y reputación.  De hecho mi compañía (SEAQ) ha logrado varios contratos para implementar con éxito está tecnología.

Yo uso primordialmente Ubuntu como mi escritorio de elección y de vez en cuando debo acceder a consolas de máquinas virtuales usando Spice, como esta es una tecnología Red Hat obviamente esta certificada para trabajar en escritorios Red Hat y Fedora pero no está oficialmente disponible para Ubuntu, a pesar del formidable esfuerzo realizado por múltiples personas alrededor del mundo con algunos PPAs (Como el PPA de Jason Brooks) por diferentes razones no conocidas por mí (seguramente la falta de tracción) el paquete no ha llegado a Debian y por ende tampoco ha logrado llegar a Ubuntu.

Afortunadamente para nosotros, un señor llamado Petter Reinholdtsen (thank you Petter) hizo todo el trabajo sucio y armo un paquete que envió a la cola NEW de Debian Unstable. Sin embargo como el proceso de aprobación puede ser un poco demorado les comparto este atajo mientras tanto:


1. Obtenga el paquete spice-xpi de Fedora o Red Hat  (Puede necesitar una suscripción Red Hat para el último enlace)

2. Instale alien en su máquina Ubuntu (sudo apt-get install alien)

3. Convierta el RPM en un DEB. ( sudo alien spice-xpi-2.7-24.el6.x86_64.rpm)

4. Install spice-xpi dependencies (sudo apt-get install spice-client liblog4cpp5 )

5. Instale el paquete convertido (sudo dpkg -i spice-xpi_2.7-25_amd64.deb)

6. Esta es la parte FEA, pero funciona a menos que requiera hacer debugging. El paquete spice-xpi requiere la librería liblog4cpp4 y acabamos de instalar la versión 5.  Necesitamos "hackear" eso.

sudo ln -s /usr/lib/liblog4cpp.so.5 /usr/lib/liblog4cpp.so.4
sudo ldconfig

7. Un hack adicional, el paquete de Firefox en Fedora utiliza una ubicación diferente para los plugins de la que usa el paquete de Ubuntu, por lo que debemos corregirlo:

 sudo ln -s /usr/lib64/mozilla/plugins/libnsISpicec.so /usr/lib/mozilla/plugins/libnsISpicec.so


8. Reinicie Firefox y listo:



interesante, eh ?

Después de eso puede ir a la interfaz de RHEV y probarlo:







Super!