Eubolist's Blog

about IT, Linux, the web and much more

Posts Tagged ‘howto

Howto: Create a bootable Linux USB flash drive (USB-stick) in Mac OSX

with 7 comments

For Windows and Linux there’s UNetbootin, in OSX you have to rely on the terminal to create your USB flash drive.

Step 1: Download the image of the distro you want to use. In my case XUbuntu 10.04.

Step2: If there is data that you still need on your flash drive, save it on your desktop or somewhere else on your harddrive. I created a folder ‘Data’ on my desktop.

Step3: Open a terminal and type in mount . This should give you a list of mounted drives on your Mac, like this:

eubolists-macbook-pro:~ eubolist$ mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk0s3 on /Volumes/BOOTCAMP (fusefs, local, synchronous)
/dev/disk1s2 on /Volumes/Time Machine-Backups (hfs, local, nodev, nosuid, journaled)
/dev/disk3 on /Volumes/8GB DRIVE (msdos, local, nodev, nosuid, noowners) <– This is the one we want
Step 4: Unmount the drive: diskutil umountDisk /dev/disk3 Of course you may have to change disk3 to whatever disk your flash drive is.
Step 5: Write the image: dd if=/Users/eubolist/Downloads/xubuntu-10.04-desktop-i386.iso of=/dev/disk3 bs=1m
Again, change the command as needed. The path to your image is in all probability different as well as the path to your flash drive.
Now you should see the light of your flash drive flashing and after a while an output that looks similar like the following:

681+1 records in
681+1 records out
714168320 bytes transferred in 225.925632 secs (3161077 bytes/sec)

If that’s the case, congrats! You should have a bootable flash drive now. If you want to, you can create another partition if you have enough space and put the data saved earlier in Step 2 back on your usb drive now.
NOTE: If you have an older PC it might still not boot from your flash drive, even if you did everything well. Some older BIOSes just don’t support booting from USB flash drives.

Written by eubolist

2010/05/24 at 19:42

Spirit – the jailbreak for the iPad

leave a comment »

Today the Dev-Team has released their latest stroke of genius: Spirit is the name of the latest untethered jailbreak for iPad, iPhone and iPod Touch. Before you jailbreak your device you should take two steps:

  1. Save the SHSH blob of your device. To do so you either have to download the necessary tool for Windows or Mac or edit your hosts file (/etc/hosts) to point “gs.apple.com” to “74.208.10.249” (Saurik’s server)
  2. Perform a full backup with iTunes! Especially if you’re trying to jailbreak your iPad – the whole procedure as well as Cydia on iPad is still considered beta.

Then go to http://spiritjb.com/ and download the jailbreak application for Mac or Windows. The jailbreak itself is as easy as one single click.

Written by eubolist

2010/05/03 at 15:46

Howto: Ubuntu Lucid Lynx Beta 1 Encrypt System Partition using Live CD

with 5 comments

In case the alternate installation doesn’t work for you (there have been some bugs reported in the current Beta 1 version) or you only downloaded the Desktop CD and now suddenly decided to install Ubuntu on an encrypted partition, this is the right guide for you. If you just like pretty GUIs that’s okay too, but be aware that for this tutorial you should be comfortable working from the terminal. (though most of this tutorial you can just copy – paste into a terminal window).

Let’s start by installing lvm2 on your live system (the desktop cd doesn’t have that by default), open a terminal and type:

sudo su

aptitude update && aptitude install lvm2

If that fails check your network connection. You need a working internet connection to download the package. Now you need to set up (at least) two partitions:

  • /dev/sda1: an unencrypted /boot partition (around 250 MB) and
  • /dev/sda2: one encrypted LVM volume for your / filesystem and swap.

In your system it may be /dev/sdb or whatever you choose: Adjust the following commands to your system configuration:

cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/sda2

When choosing a password take a long, safe password which is not prone to dictionary or brute force attacks. But also make sure you won’t forget it – if you forget your password all your files and settings will be lost.

cryptsetup luksOpen /dev/sda2 lvm

pvcreate /dev/mapper/lvm

vgcreate ubuntu /dev/mapper/lvm

lvcreate -L 1300M -n swap ubuntu

You can change the size of the swap partition, usually a value 1.3-1.5x your RAM size is fine.

lvcreate -l 100%FREE -n root ubuntu

If you want more than one partition (eg. a seperate /home partition) don’t use 100%FREE but the value you wish and define the additional partitions using the above scheme before proceeding to the next step.

mkswap /dev/mapper/ubuntu-swap

mkfs.ext4 /dev/mapper/ubuntu-root

Now start the installation process (don’t close the terminal yet, we’ll need it later). In the partitioning step choose /dev/mapper/ubuntu-root -> Mount point: / and reformat the partition with ext4. Choose /dev/sda1 -> Mount point: /boot and also reformat the partition.

Then continue your installation. On my system it wasn’t able to install the bootloader – don’t worry, we’ll fix that later, just continue with the installation. Once it’s finished don’t restart the system: Close the window and go to the terminal again.

mount /dev/mapper/ubuntu-root /mnt
mount /dev/sdX1 /mnt/boot
mount -o rbind /dev /mnt/dev
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
chroot /mnt

Now you’re chrooted in your new installation and able to modify it in order to boot into the encrypted partition. Install the necessary software:

aptitude install cryptsetup lvm2

Then you need to write the UUID of the encrypted partition into /etc/crypttab

echo “lvm UUID=VOLUME_ID none luks” >> /etc/crypttab

You can find out the volume id by typing blkid /dev/sda2 in your terminal. Lastly you need to update the initramfs with

update-initramfs -u -k all

If you were able to install the bootloader grub during the installation process you’re done now, you can exit the terminal and reboot. If not there are three more commands you need to run before exiting:

aptitude install grub2

grub-install /dev/sda

update-grub

If all went well you have a 10.04 installation with an encrypted system drive now. Congratulations!

NOTE: The last part of this tutorial (chrooting plus installing grub) may also serve as a workaround if you encounter any problems or bugs setting up grub during the regular installation process.

Written by eubolist

2010/04/05 at 18:51

A guide to make safe passwords

with 2 comments

There are a lot of informations out there on how to make secure passwords, most of which are about passwords for cryptographic purposes, written by security experts. Of course the most secure password form is a true random password consisting of upper/lowercase letters, numbers and special characters. There are a lot of web services out there to generate such strings, take this one for example: http://clsc.net/tools/random-string-generator.php

Now it occurred to me, that some security enthusiasts – and some folks at Microsoft – also advise people to choose random passwords for their accounts (computer, mail, social networking …) as well – to make it safe, of course. This is idiotic because the average user certainly does not want to memorize multiple random strings and this policy would encourage users to use one password for all their accounts. Using the same password for multiple accounts is a very bad idea – if one account gets compromised (the programmers at your dating site didn’t do a great job in securing their server) all your other accounts (PayPal, eBay, …) will be in danger, too. And even if you can memorize the random password there is a good chance that you will forget it once you haven’t used it in a while. Which is quite probable to happen since most people are too lazy to always type the password and decide to store it in Firefox, the keyring or whatever password manager they’re using. So don’t use random passwords as long as you’re not an autistic savant genious with a superhuman memory.

Now, since I’ve condemned the really safe option of random passwords let’s have a look at the two possibilities an attacker has to crack your password. The first method would be a dictionary attack: The attacker uses a dictionary file with lots and lots of words in it as possible passwords. This attack is the reason why it’s a bad idea to use simple words without modification as passwords. The second method is a bit simpler, it’s called brute force attack.  Similar to the dictionary attack the attacker tries to guess your password, this time – as the name suggests – every possible password is tried, starting with a and ending with ZZZZZZZZ… Brute force is a lot slower than a dictionary attack because obviously many more passwords have to be guessed until the right one is found. But the big advantage is that the password doesn’t have to be a word, so a password such as “123++” doesn’t offer a lot of protection against brute force attacks, despite being quite strong against a dictionary attack (always depending on the dictionary used, of course).

So what properties does a password need to be safe?

  • It should be long. The longer the better. Why not use a short sentence for example? A short sentence consisting of a few words is very easy to remember and contains a lot of characters, making it hard to break. In case spaces are not allowed you can just leave them out or substitute them with a dash or a certain number.
  • It should contain upper and lowercase letters, numbers and special characters. Adding a number and a special character after your usual password vastly increases the security of your password. Let me show an example: if “monday” is your usual password, it consists of 10 lowercase letters. So a brute force attacker has to try a maximum of 246 possible passwords until he eventually will guess the right one. Given he can try 5000 passwords per second he will crack your password in about 10 hours (he would even be a lot faster if he used a dictionary attack in this example). Now we add a number and a special character to your password and capitalize the first letter: “#0nd4y” A brute forcer would have to try the full ASCII set to crack your password: 1286 which would, at the same speed, take the attacker almost 140 thousand years!
  • It shouldn’t be a plain (or simple variation of a) dictionary word. Even if the above sample may seem secure against brute force attacks, it may not be against a dictionary attack where the dictionary has been added variations of the words (a huge list like that can be easily and quickly generated with an automated script). Use words from foreign languages you know, they are not likely to be in a dictionary (since the largest dictionary files are English, and who would guess eg. a french password on a Spanish user and website?)
  • As I already mentioned: One password per account! Don’t use the same password for multiple accounts. Just don’t.
  • Finally, the last and maybe most important point: It should be easy to memorize! How can one achieve that regarding my other points above? Even passwords containing special characters or numbers are easy to memorize if you create yourself a pattern. There an infinity of patterns you could use to generate safe, easy-to-memorize passwords. Here are a few ideas: Always add the same number (e.g. your birthdate) plus one special character after or before the word you use: puppy –> 1351976?puppy / 1351976=puppy / 1351976@puppy / … Or play around with a whole sentence: puppy –> i have a cute puppy 9877+*$ / i-have-a-cute-puppy9877 / ihaveacutepuppy+*$ / i9have8a7cute7puppy!!! / …

This way even if you don’t use a password for a long time you, and only you, will still be able to guess the right one amongst the most likely variations that you have in mind. And even though I certainly do not consider myself a security expert, I think this is one of the safest, most reliable ways to choose your passwords for everyday users.

Written by eubolist

2010/02/19 at 17:12

Howto: PPTP VPN Server with Ubuntu 10.04 ‘Lucid Lynx’

with 19 comments

This tutorial describes how you set up a computer as a dedicated VPN server for your network. With a VPN server you can open secure data tunnels and access files and deivces in your local network (eg. home or office) from remote locations, which is not only a pretty cool thing (accessing your media library from anywhere) but also very handy for system maintenance or customer support or if you want to work from home.

VPN scheme

A simple scheme how VPN works: Through your VPN server you will have full, secure access to your LAN (source: caconsultant.com)


Note that Lucid Lynx is still in Alpha 2 stage at the time of writing this article, this means you should only use it for testing purposes. Although the server I’ve set up writing this tutorial has been running without any kind of problems for two weeks now I recommend if you want to set up a Ubuntu server in a working environment you to go back to 9.10 ‘Karmic Koala’ or even an earlier stable version. Okay, this being said
let’s get started:

1. Download the Lucid Lynx Alpha 2 server CD image from this page: http://releases.ubuntu.com/releases/10.04/

2. Follow the installation wizard and install the core system

3. Under software selection select OpenSSH server – for remote management of the machine – and manual package selection for the actual pptpd package. If you want more services, for example if you want to use the computer also as a webserver, you may of course select the additional software. For security reasons I generally advise people to only run one from the outside accessible service per machine if set up in a critical environment, but really that’s up to you.

Lucid server install, software selection

Software selection

4. In manual selection navigate to ‘not installed packages’ -> ‘net’ where you will find pptpd. Select it and press ‘g’ twice in order to install the package.

Lucid server install package selection

Package selction --> PPTPd

5. Let the installation finish and reboot your system.

6. SSH into your newly set up machine and run ‘sudo aptitude update && sudo aptitude safe-upgrade’ first to update all packages. Reboot if necessary.

7. Open the pptpd.conf file: ‘sudo nano /etc/pptpd.conf‘ Adjust the IP settings at the bottom to your needs. Under local IP you enter the IP in the local network of your VPN server (if you don’t know it type ‘sudo ifconfig’ and it will show you your network interfaces and the assigned IPs). For that matter I recommend to set up a static IP in /etc/network/interfaces or in your router configuration.

8. If you want to, you can change the hostname in /etc/ppp/pptpd-options

9. Specify the user names and passwords you want to give access to your vpn: ‘sudo nano /etc/ppp/chap-secrets‘. If you changed the hostname in the step before make sure you type in the same hostname now under ‘server’

Example:

# client server secret IP addresses
eubolist pptpd myübersecretpassword *

As in pptp there is no keyfile security depends solely on the password. Which is why you should choose a long (eg. 32 characters), random password. You can generate such a password here.

10. Now we need to set up ip-masquerading: ‘sudo nano /etc/rc.local

Add the following lines above the line that says ‘exit 0

# PPTP IP forwarding

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Optionally I recommend securing your SSH server against brute force attacks:

# SSH Brute Force Protection

iptables -A INPUT -i eth0 -p tcp –dport 22 -m state –state NEW -m recent –set –name SSH
iptables -A INPUT -i eth0 -p tcp –dport 22 -m state –state NEW -m recent –update –seconds 60 –hitcount 8 –rttl –name SSH -j DROP

(also to be inserted above ‘exit 0’)

You may have to change ‘eth 0’ to another interface, depending on which interface is configured to connect to the internet on your machine.

11. Lastly, uncomment this line in /etc/sysctl.conf:

net.ipv4.ip_forward=1

12. Reboot

13. In case your vpn-server doesn’t directly connect to the internet you may need to forward port 1723 TCP and GRE to the LAN IP of your vpn-server. Refer to your router’s manual or to portforward.com for vendor specific instructions.

Done. Enjoy!

UPDATE(2010-07-18): If connecting to the vpn-server goes well but you can’t connect to the internet you might want to try uncommenting the ms-dns entries in /etc/ppp/pptpd-options so it looks like this:

ms-dns 208.67.222.222
ms-dns 208.67.220.220

Written by eubolist

2010/01/28 at 15:56

Howto: RSS-Feed for TV Show Torrents

with 5 comments

I found this awesome page where you can simply create a list from virtually all available TV shows, feed the URL to an RSS capable BitTorrent client and enjoy fully automatic downloads of the most recent episodes.

The procedure is very simple:

1.) Go to http://showrss.karmorra.info/ and create an account.

2.) Add shows to your personal feed. Mine looks like this:

3.) optional: by clicking on the little gearwheel on the left list you can customize the settings for each show, eg. whether to download in HD or not:

4.) Get the feed address! Click on “feeds”, then adjust the settings as you wish and click “Generate”

5.) Feed the link you are given to your favourite BitTorrent application. Personally I use Miro, but you can also use Vuze (formerly known as Azureus) or µTorrent. For a good list of BitTorrent clients and their features  see Wikipedia.

Written by eubolist

2010/01/15 at 10:09