Showing posts with label encryption. Show all posts
Showing posts with label encryption. Show all posts

Sunday, July 3, 2011

debian apt NO_PUBKEY error

A sample error message:

W: GPG error: http://download.virtualbox.org lenny Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54422A4B98AB5139

You can fix it by adding the missing public key by:

# gpg --keyserver subkeys.pgp.net --recv 54422A4B98AB5139
# gpg --export --armor 54422A4B98AB5139 | apt-key add -

Thursday, February 10, 2011

how to add pub key to gpg and add it into apt keyring

# gpg --keyserver subkeys.pgp.net --recv-keys <KEY_ID>
# gpg -a --export <KEY_ID> | apt-key add -

Wednesday, February 9, 2011

how to force install perl module from cpan

perl -MCPAN -e "CPAN::Shell->force(qw(install IO::Socket::SSL));"


Friday, September 10, 2010

how to set up crypted partition under Ubuntu 8.04 or Debian stable (5.0)

Install cryptsetup:

# apt-get install cryptsetup

Load 2 modules:

# modprobe dm-crypt 
# modprobe dm-mod

Use luks to format partition and map it to a device:

# luksformat -t ext3 /dev/sdb1
# cryptsetup luksOpen /dev/sdb1 crypteddisk


crypteddisk is a user defined name.  You can name it whatever you want.  It will be found under /dev/mapper.

I put this line in /etc/crypttab:

crypteddisk /dev/md0 none luks,noauto

I also put this line in /etc/fstab:

/dev/mapper/crypteddisk /data ext3 defaults,noauto 0 0 

Make sure you have /data/ directory and maybe prevent it to be used before being mounted by chattr +i /data.

Now you can mount your new encrypted partition by:

cryptdisk_start crypteddisk
mount /data


Note that I config fstab and crypttab in such a way that it won't automatically mount the encrypted partition at boot time.  You know why?  Thinking about when the machine you are working on is a server located in some data centre (no need to be so far away from your house).  If you set it to be auto mount, it will ask you to enter the LUKS passphrase at boot time which means you won't be able to ssh to the machine as it will just wait there forever until you enter the password lol