Using Backtrack 5 R1 as Desktop Operating System: BT for Beginners

| Comments

Backtrack is one of the most famous penetration testing Linux distros. It is derived from Linux 10.04, but it is not as easy as Ubuntu to use for a rookie Linux user. BT5 R1 has made it a lot easier to use it as a Desktop OS, but here is how I tuned my machine this time.

Adding Unprivileged user

Default user in BT is root, since it is made for penetration testers and root privileges are needed for running almost all the tools. But, we are using it as a Desktop OS and for general usage, super user privileges are dangerous. So we’ll add a normal user (like a default user in Ubuntu and Mint). BT5 R1 has made this job a lot easier. We must need to issue a single command:
adduser username
where username is name of user we want to add.
In previous versions of BT, we have to install adduser program using “apt-get install adduser”.


Allowing “sudo” for new user

Now we have added a new user, but it is totally powerless. You would not like to switch to root to do every small task which require super user privileges. So we will allow the usage of sudo command for out newly born user, for this we have to add the user to sudoers list. Run the following command for this:
visudo
Pretty small one, isn’t it…:P   Of course, we need to be logged in as root to run this command.
This will open sudoers file in “nano” editor in terminal for editing. Default configuration allows only root to have all the powers. In the file where you see:
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
After this add a line same as above but replace “admin” with username of your choice and for example add following line for allowing “channi” to use sudo :
%channi ALL=(ALL) ALL
Remember, in any case if sudo don’t work, we can easily switch to root using ” su root” command from within our normal user session, but don’t use it recklessly. 
After editing, exit nano using ctrl+X and save the file.

Editing fstab

When logged in as a normal user, we are not allowed to access the filesystem freely. Even when we have added the user to be in sodoers list, there are several restrictions on using it. We can remove most of these by editing fstab, which is the system file which contain information about how and which filesystems/partitions will be mounted. This will also allow us to automount partitions of our choice. 
Don’t forget to make a backup before you edit anything. fstab is a really critical file, edit it carelessly and you will never be able to boot your system.
To start editing fstab, issue following command:
sudo gedit /etc/fstab
Don’t change anything in the file. We’ll just add some new lines. For example for adding a partition, I added this line:
UUID=26440134013F55 /media/F ntfs defaults,auto,uid=1001,gid=1001,umask=007 0 0
Follow these steps to edit fstab on your machine:

Find UUID: First we must know the UUID of the partition to be added. For that run following command:
sudo blkid
and figure out the partition of choice and replace the UUID above.

Place to mount: Next is the place where we want to mount the partition (/media/F) in my case. Before mounting the partition on a place, that directory must already exist on filesystem. For example, to mount it as F in “/media”, first create a directory named F (using “sudo mkdir /media/F”). Than add that location in above line.

Filesystem: Next is the filesystem of the partition. If you don’t know what is it, blkid tell you that as well. In my case it is a old windows NTFS partition where I keep binaries.

How it should be mounted: Next is the list of options with which partition will be mounted. It is a comma separated list so don’t add spaces or tabs. There are a number of options, “defaults” set them all to default, and they can be explicitly stated if defaults don’t suit us. Like we have written “auto” after “defaults”. This will automatically mount the partition after reboot.
Next are uid and gid. uid stands for User ID, ID of user who will own the files on partition. We can find it by running this command while logged in as he normal user, “echo $UID”. And gid is Group ID, ID of group who own the files on partition. Use this command to find it,
cat /etc/group|grep channi
where channi may be any username.
Next is umask. It decides what permissions will be for User, Group, and Others (umask=UGO). It has to be numbers between 0 to 7, where 0 is for all permissions (read write and execute) and 7 for no permissions.

Final columns: Final columns should be 0 and 0. These are dump and fsck options (which have no business with us). Leave them for Linux filesystem to handle, just set them to zero.
More partitions can be added similarly. You can read this article for more information on editing fstab.
TO check if everything went well, issue “sudo mount -a” (unmount the partitions before this) . I needed to reboot my machine for changes to take effect completely.

Installing Codecs

Now it is about time to install codecs and watch some movies and play music. We will install Ubuntu restricted extras for that. First we need to add medibuntu repository and than we’ll install codecs. Use following command for all that:


sudo wget http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list --output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get -q update&& sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring && sudo apt-get -q update && sudo apt-get install -y ubuntu-restricted-extras non-free-codecs w32codecs libdvdcss2

Everything is done with that huge command. Now we can install vlc, mplayer or whatever of your choice. Or if it didn’t work for any reason, try entering individual commands:
sudo wget http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get -q update
sudo apt-get install -y ubuntu-restricted-extras non-free-codecs  32codecs libdvdcss2
Wanna read some Books ?
For those addicted to ebooks, a pdf reader is must. We can simply install “evince”, default pdf reader in Ubuntu (till now) using:
sudo apt-get install evince
Archive Manager
For extracting and compressing file archives, it is better to use command line. OR we can install Archive Manager (
file-roller)
 to make the life easy. Just type this in terminal:
sudo apt-get install file-roller
And what about the Firewall ?

Backtrack has a firewall pre-installed  but is disabled by default. For day to day usage, it can be enabled through following commands:
To check the status of Firewall:
sudo ufw status
To enable it:
sudo ufw enable (disable in order to disable it)
For more commands:
sudo ufw commands

We can also install a gui to manage Firewall settings. Use following command to install it:
sudo apt-get install gufw


Some Unnecessary tuning

All that is enough for a smooth operation, but there are still some tweaks you would like to try.

A login screen: We cam install a login screen as that of Ubuntu for logging in. We’ll install gdm (for gnome and kdm for kde) for that:
sudo apt-get install gdm

But this is not enough, we have to edit gdm configuration file to make it work on startup. To edit the gdm configuration, file issue following command:
sudo gedit /etc/init/gdm.conf (kdm.conf for kdm)
This will open gedit window. Now in that file, look for “script” and “end script” block. Delete everything except last two lines, make it read:

script
    export XORGCONFIG
    exec gdm-binary $CONFIG_FILE
end script  
for kdm it should be,

script    export XORGCONFIG
    exec kdm
end script  
It will make a login screen appear on startup instead of pointing to first Virtual Console. X Server (GUI) will start in 7th virtual console now.
To do more tweaks with the Graphical User Interface, we can install Ubuntu-tweak. Issue following commands for that:

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get updatesudo apt-get install ubuntu-tweak
You can access Ubuntu-tweak by writing “ubuntu-tweak” command in terminal. It will allow you to change a lot of things, including login wallpaper, computer name etc etc. I personally don’t like using such tools, but just in case you like it. 
I am not a fan of Candy graphics, so I myself have not installed any of the extra graphic themes/effects, but if you like you can try installing Compiz Fusion. Do it using Synaptic (you will need to install it on BT, use “apt-get install synaptic”). You can read this article for little more tuning of User Interface in Backtrack
Hope this helps…: )
If you have anything more to share or I said something wrong than please state it in a comment.



Circle Beat Of The Geek on Google Plus
OR Like us on Facebook  OR Follow on Twitter

Comments