All posts by HydTech

/tmp folder permissions changing after reset / reboot in BackTrack 3 and 4

KDE requires the /tmp directory to have the correct permissions (1777) for a user to log in or it will give you an error saying: “call to Inusertemp failed. temporary Directories Full?”. For this you have to change the folder permissions of /tmp by:
chmod 1777 /tmp

This will give permissions of drwxrwxrwt. One problem I was having with BackTrack was that after every reboot, the permission would get set back to dwrwxr_xr_x. I realized this was happening due to BackTrack using the aufs file system to mount root. The aufs or AnotherUnionFS is used on the live CD to make it appear as writeable but in reality the media is physically read only.

To eliminate this problem, open fstab:
kwrite /etc/fstab

And replace the aufs line with your device and the correct file system.
For example: /dev/sda8 / ext3 defaults 0 0

How to add new users to BackTrack 3

After installing BackTrack, it is important that you change the default password for security reasons. Also, you might want to add a user to the system so you can avoid using the root login as you don’t want to screw things up accidentally.

To add a new user, open up a Konsole and type:

adduser

This will guide you through the process of adding a new user.

adduser

keep hitting enter for all default values and select a good password:

adduser1

your user is created but KDE still won’t let you log on because /tmp does not have the correct permissions. you will get an error saying “call to Inusertemp failed (temporary Directories Full?)”

To set the correct permissions type:
cd .. to go up one directory

chmod 1777 /tmp to set the correct permissions on the tmp dir. * see UPDATE *
adduser2

now you can logoff root and login with your new user.

check here to install packages using slapt-get.

* UPDATE * – I found out on reboot these permissions get reset. To make permanent changes see here.

How to Install OpenOffice 3.0.1 in BackTrack 3

goto openoffice.org and download the version for linux.

untar:
tar -xvzf OOo_3.0.1_LinuxIntel_install_wJRE_en-US.tar.gz

cd into directory with all the rpm files:
cd OOO300_m15_native_packed-1_en-US.9379/RPMS

convert all rpms to tgz:
rpm2tgz *.rpm
This step will take a while.

Install all tgz using installpkg tool:
installpkg *.tgz

openoffice will be installed under /opt

Now we have to place it in the K menu.
Right click on the K and click Menu Editor.
goto File -> New Submenu -> type OpenOffice
Right click on OpenOffice Menu and select new item.
Add a name, description and in the “Command” field, add ‘/opt/openoffice.org3/program/soffice’
In “Work Path” add /opt/openoffice.org3/program
save and close

You can repeat the steps to add Writer, Calc, Math, Draw, Impress and Base

How to install Mozilla Thunderbird and Opera browser in Backtrack 3

Check my previous post on how to install slapt-get in BackTrack 3.

Now, you can use slapt-get to install packages from the slackware repositories. To install mozilla-thunderbird:

Make sure it exists in the repositories:

slapt-get --search thunderbird

if you find it, use the install parameter to install:

slapt-get --install mozilla-thunderbird-2.0.0.21-i686-1

snapshot2

For Opera, goto www.opera.com/download and download the latest tar.gz for Slackware.

untar the file:
tar -xvzf opera-9.64.gcc4-shared-qt3.i386.tar.gz
go into the folder and run install.sh
untar
That’s it !

How to install BackTrack 3 or 4 to hard drive along with Windows XP, Ubuntu, Fedora, openSuse on Lenovo Thinkpad X60

From my last post you can see that I installed Fedora and openSuse to my existing dual boot Thinkpad X60 with Ubuntu and Windows. In this post, I will show you how to install BackTrack 3 to the hard drive. These instructions can also be used for BackTrack 4.

First we have to create a partition for the OS. You can only have 4 primary partitions out of which only 1 can be an extended partition. The extended partition can then in turn have multiple logical partitions. I used gparted in Ubuntu to partition my drive as follows.

Primary partition 1 – NTFS for XP
Primary partition 2 – NTFS used as storage
Primary partition 3 – extended partition which has all my linuxes for testing purposes
extended partition contains:
logical partition 1 – ext3, Fedora
logical partition 2 – ext3, openSuse
logical partition 3 – ext3, will be used for Backtrack
logical partition 4 – ext3, future linux (maybe Gentoo)
logical partition 5 – swap (I only have to use one swap for all my linuxes)
Primary partition 4 – ext3 for Ubuntu, my main linux

qtparted

Now download, burn, and boot up BackTrack 3 live cd.

My BackTrack partition is sda8 and BT3 automatically mounted it to /mnt/sda8

if not, you can mount your drive by typing:
mkdir /mnt/sda8
mount /dev/sda8 /mnt/sda8

replace sda8 with your partition

now, copy the required files from the live cd to the hard drive:

cp --preserve -R /{bin,dev,home,pentest,root,usr} /mnt/sda8/
cp --preserve -R /{boot,lib,etc,opt,sbin,var} /mnt/sda8/
mkdir /mnt/sda8/{mnt,proc,sys,tmp}
mount --bind /dev/ /mnt/sda8/dev/
mount -t proc proc /mnt/sda8/proc/

The installation is done, now you can reboot and add the BackTrack to the grub menu.lst

Reboot into Ubuntu and:
sudo gedit /boot/grub/menu.lst

This is what my grub looks like. The part in bold is for BackTrack:

title Ubuntu Jaunty, kernel 2.6.28-11-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=da7e4aba-35c8-4ab8-a882-d5c7c324101a ro quiet splash
initrd /boot/initrd.img-2.6.28-11generic
quiet

title Ubuntu Jaunty, kernel 2.6.28-11-generic (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=da7e4aba-35c8-4ab8-a882-d5c7c324101a ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu Jaunty, kernel 2.6.24-16-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=da7e4aba-35c8-4ab8-a882-d5c7c324101a ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
quiet

title Ubuntu Jaunty, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
makeactive
chainloader +1

# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title Fedora (2.6.27.19-170.2.35.fc10.i686) (on /dev/sda5)
root (hd0,4)
kernel /boot/vmlinuz-2.6.27.19-170.2.35.fc10.i686 ro root=UUID=cae92252-724a-4e24-841d-e8c3fb24f861 rhgb quiet
initrd /boot/initrd-2.6.27.19-170.2.35.fc10.i686.img
boot

# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
#title Fedora (2.6.27.5-117.fc10.i686) (on /dev/sda5)
#root (hd0,4)
#kernel /boot/vmlinuz-2.6.27.5-117.fc10.i686 ro root=UUID=cae92252-724a-4e24-841d-e8c3fb24f861 rhgb quiet
#initrd /boot/initrd-2.6.27.5-117.fc10.i686.img
#boot

# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda6.
title openSUSE 11.1 – 2.6.27.19-3.2 (on /dev/sda6)
root (hd0,5)
kernel /boot/vmlinuz-2.6.27.21-0.1-default root=/dev/sda6 splash=silent showopts vga=0x317
initrd /boot/initrd-2.6.27.21-0.1-default
boot

# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda6.
title Failsafe — openSUSE 11.1 – 2.6.27.19-3.2 (on /dev/sda6)
root (hd0,5)
kernel /boot/vmlinuz-2.6.27.21-0.1-default root=/dev/sda6 showopts ide=nodma apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x317
initrd /boot/initrd-2.6.27.21-0.1-default
boot

title BackTrack 3 Final KDE
rootnoverify (hd0,7)
kernel /boot/vmlinuz vga=0x317 root=/dev/sda8 ro quiet splash autoexec=xconf;kdm
boot

title BackTrack 3 Final shell
root (hd0,7)
kernel /boot/vmlinuz ro root=/dev/sda8 vga=0x317
boot

Reboot into BackTrack and check here to create a new user and

check here to install packages with slapt-get or here to see how I installed BT 4 on my lenovo S10 without a CD player or USB.

How to Install packages with slapt-get or gslapt in BackTrack 3

Once BackTrack is installed on the harddrive, open the menu and goto K -> BackTrack -> Penetration -> Fast Track
type:
./fast-track.py -i
snapshot
Enter the Fast-Track updates menu (1).
Update everything (9).
snapshot1

After the update finishes, select the Installation menu (8).
Install everything (8).
Go back to the Installation menu, select Install Slapt-Get (1)
Install Slapt-Get (2), then select update SlackWare (1).
Exit (10)

Now, you can use slapt-get to install packages from the slackware repositories. For example, if you want to install mozilla-thunderbird:
Make sure it exists in the repositories:
slapt-get --search thunderbird
if you find it, use the install parameter to install:
slapt-get --install mozilla-thunderbird-2.0.0.21-i686-1

snapshot2

you can also use the gui front-end for slapt-get, but it is broken by default in BT3. so let’s reinstall it:
slapt-get --install --reinstall gslapt

How To contribute to Ubuntu, report bugs at launchpad, find and install latest *.deb

Reporting bugs using launchpad:
http://www.freesoftwaremagazine.com/columns/ubuntu_help_reporting_bugs_using_launchpad

Finding and installing latest *.deb files:
http://www.freesoftwaremagazine.com/columns/weekly_tip_finding_installing_deb_files

Ways to contribute to Ubuntu:
http://meandubuntu.wordpress.com/2009/01/09/ways-you-can-contribute-to-ubuntu/

Become a GNOME translator:
http://adi.roiban.ro/2009/03/03/contribute-to-gnome-as-a-translator/

Another contributing thread:
http://ubuntuforums.org/showthread.php?t=896777

Ubuntu wiki about contributing:
https://wiki.ubuntu.com/ContributeToUbuntu

How to install Opera and Thunderbird and share the profiles between Windows, Ubuntu, Fedora and openSuse

Mozilla thunderbird saves the settings in a file called profile.ini. This file contains the location of the folder which has all your mail and settings. When first installed and loaded, thunderbird creates a random folder like diy1bg1t.default.

Opera settings are stored in Opera6.ini. This has information for the location of other settings files, like wand passwords, plugin locations, etc.

I installed these programs on Windows first and kept the default settings and locations for these files. After installing Ubuntu, I had to figure out a way to share the profiles, but back then people were suggesting to make a common FAT32 partition and keep these files there so Linux could have read and write access to them. With NTFS-3G, this became much easier and I just left the files on the NTFS partition. Later on I installed Fedora and openSuse on the same machine and used the same directions like Ubuntu. (Check here to see my post about Quad Booting my Thinkpad with Windows, Ubuntu, Fedora, and openSuse)

The first step was to make sure the NTFS partition was mounted at start up. I made a folder for the mount:

sudo mkdir /media/sda1

On startup, the system looks for partitions to mount in fstab. If you need more information on mounting and fstab, I recommend this post at ubuntuforums.org

opened fstab for editing:

sudo gedit /etc/fstab

added the following entry to fstab because my Windows partition is at /dev/sda1:

# My windows partition
/dev/sda1 /media/sda1 ntfs-3g defaults, locale=en_US.UTF-8 0 0

fstabfedora
Save file, restart.

Once Linux loaded back up and the Windows partition was automatically mounted, I got the packages for Opera and thunderbird and installed them with this:

In Ubuntu:
sudo apt-get install opera mozilla-thunderbird

Thunderbird In Fedora:
su
(enter password)
yum install thunderbird

installthunderbirdfedora
Thunderbird in openSuse:
used the yast2 graphical package manager.

packagemanageropensuse

installthunderbirdsuse

Opera in Fedora and openSuse:
downloaded rpm package from www.opera.com onto desktop

rpm -ivh /home/(user)/Desktop/opera-9.64.gcc4-shared-qt3.i386.rpm

installoperafedora

The mozilla profile.ini file will be under
/home/(user)/.mozilla-thunderbird for Ubuntu
/home/(user)/.thundebird for openSuse and Fedora

The folders that start with a dot are hidden and you can unhide them in Nautilus (Gnome) with “Alt+H” and in Dolphin (KDE) with “Alt+.”

The profile.ini in Linux should be something like this pointing to the folder which has your mail:

[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=0
Path=/media/sda1/Documents and Settings/(windows user)/Application Data/Thunderbird/Profiles/diy1bg1t.default

Make sure that isRelative=0 and replace the diy1bg1t with the appropriate foldername

Now when I opened up Thunderbird, I had my mail !!!!

Moving on to Opera:

After Opera was installed in Linux, I copied the opera6.ini from windows to the opera folder in Linux located at /home/(user)/.opera

opened up the new opera6.ini for editing:

sudo gedit /home/(user)/.opera/opera6.ini

and replaced all the paths C:\Program Files\Opera 9\profile with /media/sda1/Program Files/Opera 9/profile

opera6

and deleted the session folder in /.opera and created a symbolic link to point to the session folder in windows.

sessions

Opened up Opera and was happy to discover all my tabs and settings!!

Lenovo Thinkpad X60 with Fedora 10, openSuse 11, Ubuntu 9.04 and Windows XP

I’ve been using Ubuntu dual booted with windows for quite a while now, but due to driver compatibility issues and lack of knowledge used windows for the most part. Since Ubuntu 8.10, I’ve completely switched over to Ubuntu and love it. Mostly because it’s FREE! Windows is still hanging around in case I might need it for some program in the future. I use Thunderbird as my email client and Opera as my web browser. One of my main concerns was sharing the profiles for these programs, but NTFS-3G has made life easier.

After feeling comfortable with Ubuntu, I decided I needed to expand my knowledge by learning to use KDE; different package managers like yum and yast; and the possibility of having multiple Linux Oses on single partitions. After doing some research, I decided I should either go with openSuse or Fedora. Then, I figured: “Why not both?” and leave Ubuntu and Windows intact. I downloaded the Live CD’s for both Oses. The Live CD installation has less programs and tools installed compared to the DVD installation.

I opened Gparted on Ubuntu to make extra partitions for Fedora and openSuse, but I realized I can’t have more than 4 primary partitions without hacking the MBR. I deleted the Linux Swap partition because I already have 2GB of RAM. I resized my Windows and Storage partitions and made one extra partition on which I would install both Fedora and openSuse. I split the partition into 2 logical partitions of about 5GB each.

gparted

Since my Lenovo does not have an optical drive, I had to use an external USB drive and allow the BIOS to boot from it

Popped in the Fedora Live CD and installed Fedora. I selected the first logical partition and set this location as “/” (root) and opted not to use a swap space. When it asks to install GRUB, you can choose not to or to install it at the beginning of the Root partition and not at the beginning of the whole hard drive because Ubuntu has already installed GRUB there and you might not want to write over it. I chose not to install GRUB. It was a painless install. Restarted and booted into Fedora to make sure it worked.

Next, I popped in the openSuse Live CD and installed it to the second logical partition also without swap space. Again, chose not to install GRUB. Install was again pretty simple. Booted into openSuse to make sure it worked.

Now, I had to update my GRUB to include the other Oses. I could have done it manually, but I chose to upgrade my 8.10 Intrepid to 9.04 Jaunty by hitting “Alt+F2” and typing “upgrade-manager -d”, which updated the entries in GRUB automatically.

updatemanager

.

.

.

Still one more issue: How to install Opera and Thunderbird and share the profiles between Windows, Ubuntu, Fedora and openSuse. This call for a new blog entry.

.

.

.

.

.

How To save documents from Scribd when disabled by user with Ubuntu Intrepid or Jaunty

Some users disable the option to download a document from scribd but the option to print is still available. We can use this to our advantage and save the document by printing the file to PDF.

In Ubuntu, we need to install cups-pdf to create a postscript printer. Check my previous post here for a tutorial.

After installing the PDF printer, go to the document you want to save on scribd.  Select more -> Print

scribd1

Select the PDF printer and hit print.  and wait…...………. this can take upto 10-15 minutes depending on how big the file is.

scribd2

Check the print status. 6 minutes and still printing……

scribd3

When done, the file will be saved in the PDF folder we created and will be called _stdin_.pdf

scribd4