feed-image  ISSN 1836-5930

linux

Linux eBooks FREE Download

A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide


Poll

Do you care about your privacy when using a FACEBOOK?
 


Partner Linux Sites: TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

LINUX ADMINISTRATION NOTES & CODE SNIPPETS

Ubuntu and Debian google-talkplug installation howto

Installing this plugin on any Linux system should be a easy task. First download google-talkplugin_current_i386.deb package. On a Ubuntu system use: sudo dpkg -i google-talkplugin_current_i386.deb on a system where sudo is ...

Read more ...

WWW Mechanize - 401 Authorization Required

Here is a small script on how to login to a .htaccess protected page. Suppose that URL we want to login to is: http(:)//www(.)example(.)com/ and here are credentials required to login: username: www password: ...

Read more ...

Extract email address from a text file

A following perl script and regular expression extracts all email addresses from an given text file. Sample text: This perl script extracts all email addresses from an given text file. This email ...

Read more ...

Regular expression to validate credit card number

Credit card numbers contain four groups of numbers where each group contains 4 numbers. The following regular expression ( regexp ) will accept all credit card number in this format: ...

Read more ...

Regular Expression to validate US postal codes

Simple way to validate US postal codes using regular expression and optionally bash. US postall codes accept five digit ZIP number + optional 4 digit code. For example 32344-4444 and ...

Read more ...

vfat file system - unable to create uppercase directory name

Are you unable to create uppercase directory name on your storage device mounted as vfat file system. The reason for this behavior is that vfat filesystem is by default mounted ...

Read more ...

How To secure ssh

Here are couple ways on how to change your sshd default configuration settings to make ssh daemon more secure / restrictive and thus protecting your server from unwanted intruders. NOTE: Everytime you ...

Read more ...

Falling back to the standard locale - Solution

A following warning message may appear on your Linux terminal: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = ...

Read more ...

More in: Linux administration notes & code snippets

-
+
8
Linuxconfig.org
Data recovery of deleted files from the FAT filesystem

Introduction

Although FAT32 or FAT16 are very old file systems, which reflects on their poor performance in comparison with other file system alternatives they are still widely used by many electronic devices. Usually, these devices include USB stick's, digital cameras , camcorders and etc. Chances are that you own and store personal data on a device with FAT flesystem is very high as is a likelihood of an accidental deletion of your important data. In this article we will use testdisk utility to undelete files from FAT file system.

OOPS.. I have accidentally removed a video file from my camcorder ! The first thing before we start panic is to unmount USB device and create a low level backup of the device partition with a dd command.

If from any reason you cannot unmount your device, remount it with read-only permissions:

# mount -o remount,ro /dev/sdX

Any data written or file manipulation after accidental file removal will weaken our chances for deleted file recovery. On the other hand creation of a low level backup with dd command gives us an opportunity for unlimited recovery attempts since we are always able to put the entire partition back bit by bit exactly as it was right after accidental file deletion.

After file deletion from a FAT file system the actual file was not removed immediately, but the sectors on which the file resides is now available to be overwritten. From this reason a backup of the entire partition:

# dd if=/dev/sdX of=/my/storage/backup_sdX.dd

To recover a backup for *.dd file we simple reverse the process:

# dd if=/my/storage/backup_sdX.dd of=/dev/sdX

Testing conditions

To test testdisk recovery utility we will create a vfat file system, store video.mp4 and readme.txt files, get md5sum and simply remove and undelete both files.

Read more...
 
Secure Online Banking with Linux USB Live

Abstract:

Online banking is becoming a very popular way to satisfy our banking needs and this even includes people with no or very little technical background. There are numerous advantages when doing banking transactions online, such as 24/7 bank opening hours, ability to make transactions from anywhere in the world and convenience. The only problem is that we do not take our secured home PC everywhere with us. Consequently, the use of other computer and operating system rather than our own for online banking may involve a great security risk. However, what we can and usually carry on us everywhere we go is some sort of the USB key storage device. This article describes a way of building our own customized Online banking USB live Desktop.

Introduction

Solution to online banking by having an USB key with some bootable Live Linux distribution solely dedicated to serve our online banking needs can be very handy not even when traveling, but also when used on day to day basis. Usually, computers are shared among colleges, family members or friends and therefore chances are very high that our personal details will be made available to some fraudsters and their sophisticated scams and software. What is more, encrypting our non-persistent USB key will make Live USB online banking desktop worthless when falling into enemy hands. Therefore, there is no harm of storing our online passwords directly on the USB itself using an application such as gorilla-password ( double encryption ). Perhaps the outcome of this guide is not as good as the famous IronKey with all its shiny features, but we would all missed the fun if there will be no space to improve it.

This article will comprise of four major sections:

  • build Debian USB live image
  • customize desktop environment within USB live image
  • rebuild USB live image with customized environment and encryption
  • transfer USB LIVE image to USB memory device
Read more...
 
USB stick encryption using Linux

Introduction

In case you will loose your USB stick, all data stored on it will be lost and what is more important they will be most likely in hands of some other person which will then have an access to your private information and use this information in any way s/he sees fit. This is one of many fears of USB stick users. One solution which can be easily applied is to not to store any private information on USB stick, however this will diminish a prime usage of your USB stick to a bare minimum as all non-private data usually do not have to be stored on USB since they can be almost always downloaded anytime and anywhere from the Internet. Another solution is to encrypt your USB stick so it will be accessible only to those users who posses a correct password which will fit to decrypt an used encryption method. This article will deal with the second solution and that is encryption of an USB stick device.

Although encrypting an USB stick seems to be the best and easiest solution it must be said that it also comes with number of disadvantages. The first disadvantage is that decryption of the USB key must be done using a Linux system with kernel version 2.6 and higher which has a "dm_crypt" module loaded in the running kernel. In other words, you cannot use your encrypted USB stick on any Windows machine and UNIX-like system with kernel version below 2.6. Therefore, to encrypt only a part of USB stick which holds only a private information seems to be a good solution. In this article we will use USB stick of capacity 16GB known to the system as a block device /dev/sdc. We first partition the disk to hold two partitions, one for encrypted data and the other for non-private data and then encrypt only single partition intended to hold private data.

NOTE:

All data on your USB stick will be destroyed so Back up your USB stick before continuing. Replace /dev/sdX with file name of your USB block device.

Partitioning an USB stick

Let's start with partitioning of our USB stick. Insert your USB stick into PC's USB slot and as a root user execute:

# parted -l

Search the output of parted command and retrieve a Disk's file name of your USB stick. As it was already mentioned before, in this article we will use /dev/sdc. Once we have a file name of our USB stick we can create partitions to be used for encryption and for storage of non-private data. In my case I will split the USB stick into two partitions, first with size of 2GB and the rest of the space will be used to create second partition and this will produce /dev/sdc1 and /dev/sdc2 respectively. Use any partition tool you see fit for this purpose, in this article I will use parted as it seems to be becoming a standard these days:

# parted /dev/sdX

Following commands are executed within a parted interactive mode:

(parted) mkpart primary 0.0 2GB
(parted) mkpartfs primary fat32 2GB -1s
(parted) quit

First parted command had created a primary partition with size of 2GB and this partition ( /dev/sdX1 ) will be used to store encrypted data. Second command created a second partition with fat32 file system ( /dev/sdX2 ) starting from 2GB up to last sector ( -1s ). The second partition will serve as a general storage. The final look of your USB stick partition table may look similar to the one below:

Disk /dev/sdc: 16.2 GB, 16236150784 bytes
255 heads, 63 sectors/track, 1973 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000cd7ef

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         243     1951866   83  Linux
/dev/sdc2             244        1974    13903718+   c  W95 FAT32 (LBA)

Read more...
 
Install debian server in a linux chroot environment

Running Linux system inside a chroot environment allows a system admin to decrease an impact on a production server when the server gets compromised.  Change root will change root directory to all current running processes and its children to a chroot jail. Testing of various package installations and server configuration in a chrooted environment can be another handy way how to utilize a chroot jail.

This tutorial will provide a reader with step by step guide on how to install Debian with ssh daemon inside chroot environment using debootstrap.

Install chroot environment

In the first step we will create a directory in which new chroot environment will reside. For convenience during the installation we also declare temporary bash shell variable CHROOT to hold a path to chroot environment.

# mkdir -p /mnt/chroot/squeeze
# CHROOT=/mnt/chroot/squeeze

When new chroot directory is ready we will use debootstrap to install new Debian system within chroot environment. Change the architecture and debian version according to your needs. The installation may take some time as debootstrap will use your specified mirror to download and install core packages. Choose the closest mirror as it will rapidly reduce the installation time.

# debootstrap --arch i386 squeeze \
$CHROOT <URL OF DEBIAN MIRROR>

At the end of the installation you should seed output similar to the one below:

I: Configuring debian-archive-keyring...
I: Configuring apt...
I: Configuring libept0...
I: Configuring apt-utils...
I: Configuring aptitude...
I: Configuring tasksel-data...
I: Configuring tasksel...
I: Base system installed successfully.
Read more...
 
«StartPrev12345678910NextEnd»

Page 2 of 11