Saturday, September 6, 2008

Is a Plesk Dedicated Server right now me?

by: Jack Mathew

Plesk Server Administrator essentially helps the administrators to deliver their products better and faster to their clients using the server management tools. This multi-platform web based Plesk dedicated server makes administration of Linux based servers simple and automated.

This is a very simplified system to be used by end users. It allows them to create and operate several domains, and allows for efficient management of a variety of email accounts, even for those who are not very technologically comfortable.

Plesk dedicated servers are basically ideal for any sort of web administration. They have been especially designed for operating internet based businesses and are ideal for selling, reselling, publicizing, etc.

Plesk dedicated servers operate through a three tier administration system which makes it convenient for use as all functions are neatly sorted out at their respective levels. With the help of this server the Plesk Hosting Operation, Plesk Hosting Accounts and Plesk Reseller Hosting Account can be started.

The three tiers in Plesk dedicated servers are as follows:

  1. Administration Level: this is the highest level at which this kind of server functions. Here the administrators can set up and manage the system using relay parameters, DNS server templates, and control panel configurations.
  2. Reseller Client Level: at this stage, domain levels can be set, mail accounts and databases can be managed, domain tools such as Webalizer can be set up, and other controls can be affected such as setting up of traffic allowances, etc
  3. Domain Owner Level: a wide range of complex and simple tasks can be performed at this level, beginning with the creation and management of email accounts. New users can be created within the same domain, FTP services can be used, and databases can be created and managed. At this level one can also gain access to the domain statistics. Protected SSL and even non SSL directories can be created and SSL certificates can be administered to them.

Finally, Plesk makes for an ideal server for web hosts throughout the world for sharing any virtual content. The management of the server is extremely simple and a large number of automatic tasks can be performed with its help.


About the Author

DedicatedServersearch.com enables you to search for dedicated servers and dedicated hosting that matches your exact needs. DedicatedServersearch.com site is updated regularly with new dedicated server



Thursday, August 21, 2008

Free Agent: Ubuntu Linux,Free and Fabulous

I'm going to just come right out and say it: I absolutely adore Ubuntu Linux 5.04 (the "Hoary Hedgehog" release, often referred to as "Hoary"). I'm now running Ubuntu on both my laptop and my desktop PCs, and I don't think I've ever been such a happy Linux user.

There's so much to like about Ubuntu, it's hard to know where to begin. Before I even get to the product itself, Ubuntu's genesis is worth a note. Work on the distribution is funded by Canonical, a company set up by South African gazillionaire Mark Shuttleworth. Perhaps you've heard of him: He cashed out big-time when he sold his security firm, Thawte, to VeriSign, and later became the second fabulously rich guy to literally buy his way into orbit. Now he's putting his money behind Linux with an eye toward increasing the flow of Free Software to all corners of the planet.

And I do mean all corners of the planet: Ubuntu's Philosophy page lists this goal: "Every computer user should be able to use their software in the language of their choice." Couple that with other ideals like "Every computer user should be given every opportunity to use software, even if they work under a disability," and "Every computer user should have the freedom to run, copy, distribute, study, share, change and improve their software for any purpose, without paying licensing fees," and you see very quickly that the folks behind Ubuntu are interested in something more than selling you a box with some discs in it. In fact, Canonical will send you an Ubuntu disc in the mail, completely free of charge, if you'd prefer not to download the distribution yourself.

What You Get For Free

Ubuntu's installer is not going to win any beauty contests: It runs in text mode and completely ignores your mouse. It is also not the "fire it up and watch it go" experience you get with newbie-friendly commercial Linux distributions such as Xandros or Linspire.

I've been through several Ubuntu installations now, and find that I usually have to answer somewhere around a dozen questions before the installer kicks into autopilot and does its thing. None of these are the sort of questions that used to make Linux installs a nightmare: You won't need to know the timings of your video card, for instance. If you're setting up a dual-booting machine, you will need some basic knowledge of partitioning, and Ubuntu can help you shrink a Windows partition to make room on your drive. Once the installer is finished interacting with you, it starts copying files to disk, rebooting once in the process. Then you'll see your new Ubuntu log-in screen.

Once you log in, you're presented with a very clean Gnome 2.10 desktop. By default, all system icons like Computer and Home live in a Places menu at the top of the screen, leaving the desktop itself empty. Even the Trash is not on the desktop--instead it's an applet on the Gnome panel. I think this approach is mindful of the way most users use their desktop: as a place to stash work-in-progress. It's wise, then, to clear the desktop so the only items on it are files and folders that users put there.

Ubuntu's Applications menu (Windows users, think "Start menu") is very well organized--which is good, because there's no built-in way to edit the menu. This turns out to be a limitation of Gnome 2.10, and a lot of users aren't happy about it. I don't understand the gripes myself, but that's because I always put launcher buttons for the apps I use most frequently right onto my panel. If you prefer to launch your apps by pulling down a menu and looking through submenus, do yourself a favor and download the nascent Menu Editor application, which lets you set things up just the way you like.

An Entire World of Free Software

Ubuntu is based on Debian, the grandpappy of noncommercial Linuxes, and thus inherits Debian's best-of-breed package management system, Apt. You can deal with Apt via the command line or the powerful point-and-click Synaptic interface. The amount of software available is staggering. We're talking about more than 16,000 different packages, once you've enabled all the official repositories. Granted, a lot of these packages are extremely esoteric; for example, I was thrilled to find the latest version of Trn, a venerable Usenet reader that Perl creator Larry Wall first brought to life more than two decades ago. Others are simply fantastic apps that are not installed by default. If you're a software junkie, you'll have a blast browsing through the listings in Synaptic and trying out apps left and right. To access these goodies, follow the instructions at Ubuntuguide.org for adding the "universe" and "multiverse" repositories to your Apt setup.

If you like, this is the time to pull down several non-Free packages that may make your computing life better. "Non-Free" doesn't mean you have to pay for them; it just means that they do not meet the requirements to be classified as Free Software. You'll likely want DVD and MP3 support, drivers for the 3D side of your ATI or Nvidia video card, and Flash and Java plug-ins for your Web-surfing pleasure. You can also download support for Windows Media, RealNetworks, and QuickTime video formats, and even set up a package called Mozplugger that lets you play these video formats right in your browser, just like all your Windows and Mac-using friends do. We Linux users don't have to take a back seat in these matters anymore!

I recently reviewed Linspire Five-0, after which Linspire founder Michael Robertson wrote in, pointing me to Linspire's file compatibility page, and challenging me to find another version of Linux that can interact with all the formats linked to on that page. Robertson's point is well taken: To my knowledge, his is the only Linux distribution that speaks all those tongues right out of the box. But with an hour's work with Apt on an Ubuntu system, you can match Linspire's wide-ranging file type support--and you won't be stuck on a costly upgrade treadmill, either. In fact, when the next Ubuntu release ("Breezy Badger") comes out in six months' time, upgrading to it should be as painless as feeding new repositories to Apt and then typing sudo apt-get dist-upgrade in a terminal window. The system will then upgrade itself over the Internet. I can't wait.

You Know What They Say About Every Rose...

It's hard to come up with a list of gripes about Hoary. The annoyances are mostly minor--there's no pretty startup screen at boot time, for instance. The only glaring blemish is an unfortunate decision to change the default behavior of Nautilus, the Gnome file manager.

I've mentioned several times in this space that beginning with Gnome 2.6, Nautilus has had two modes of operation. One, the "File Browser" mode, is like Windows Explorer, with a two-pane display (folder tree on the left, folder contents on the right). Then there's the "Spatial" mode, which is what you get when you double-click a folder on your desktop. In Spatial mode, Nautilus behaves very much like the Finder in older versions of the Mac OS: A new window opens for every folder you access.

A lot of people think that this is a bogus way to operate. Just one of their complaints is that if you're drilling down to a buried subfolder, you end up with a screen full of windows in no time at all. Never mind the fact there's an easy way around this (the double-middle-click); Mark Shuttleworth decided, apparently by fiat, that there's a better way, and he had his coders implement it right before the Hoary release: Double-clicking a folder in Ubuntu not only opens the new folder, but also closes the previous folder window.

That does solve the glut-of-folder-windows problem, but there are a lot of reasons to dislike this new behavior. Just one example: Imagine you're navigating to a folder four levels deep in order to grab a file there and move it up to a folder only one level deep. When you arrive at your destination and find your file, its new home has disappeared; it got closed as you clicked your way down through your folders. Yes, in "Ubuntu Spatial" mode, a double-middle-click gives you what a double-click used to: It will open a new folder without killing the previous folder window.

I'm so used to the "normal" Spatial mode that I've re-enabled it on my Ubuntu machines. That's relatively easy to do via a hack in GConf (Gnome's somewhat Registry-like settings storehouse)--but before making such a big change in Nautilus, the Ubuntu gang should have provided a simple toggle for this new behavior in Nautilus's Preferences dialog.

Ubuntu Spatial mode is the only serious bummer I've found in Hoary. In all other respects, I've now got two Linux machines that are purring along and doing exactly what they should without throwing me any curveballs. Everything just works, and that's the way I like it. My hat is off to the Ubuntu folks, not only for the fine work they've done but for the way they offer it--Freely--to the world.

If you'd like to give Ubuntu a test drive before you install it, you can download a "Live CD" version. This is a self-booting CD-based version of Hoary that should give you a pretty good idea of what you'll end up with if you go ahead with a full installation. If you decide to bring the Hoary Hedgehog into your life, drop me a line and let me know what you think.

I'll be back next month with a look at some of the amazing (and amazingly friendly) applications I've discovered in the Ubuntu repositories--applications that will, of course, work on whatever Linux distro works best for you. Until then, be as Free as you can.

Which Linux is your favorite? What made you switch? What's keeping you from switching? PC World's Free Agent wants to hear from you. Speak Freely!

Sunday, August 3, 2008

[Openvpn-users] Site2Site - routing-problem (linux)

From: Martin Müller - Rudolf Hausstein

Hi everyone, I am trying to setup a site to site vpn link using openvpn. Here is what I did by
following the HOWTO and FAQ:


Purpose:
--------
* Use OpenVpn to link two site (working)
* the vpn-client can reach any machine behind vpn-server (working)
* any machine behind the vpn-client can reach the vpn-server and the network behind it (not working)
* any machine behind the vpn-server can reach the vpn-client and the network behint it (not working)


Server site
----------
Network: 192.168.100.0/24
Gateway: 192.168.100.99
VPN server: 192.168.100.9 (debain, ip_forward enabled)
VPN subnet: 192.168.123.0/24
VPN address: 192.168.132.1

route -n says:
# route -n
Kernel IP Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
192.168.123.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
83.64.124.96 0.0.0.0 255.255.255.240 U 0 0 0 eth1
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.8.0.0 192.168.100.6 255.255.255.0 UG 0 0 0 eth0
10.8.0.0 192.168.123.2 255.255.255.0 UG 0 0 0 tun0
192.168.123.0 192.168.123.2 255.255.255.0 UG 0 0 0 tun0
0.0.0.0 83.64.124.97 0.0.0.0 UG 0 0 0 eth1



Client Site:
------------
Network: 10.8.0.0/24
Gateway: not aviable
VPN Client host: 10.8.0.99 (linux, ip_forward enabled)
VPN address: 192.168.123.6

route -n says:


Symptons:
---------
Both sides start ok.
I can reach any machine of 192.168.1.0/24 from 10.8.0.99 (192.168.123.6)
I cant reach any machine of 10.8.0.0/24 from 192.168.100.0/24
I cant reach any machine of 192.168.100.0/24 from 10.8.0.0/24
I reach 192.168.123.6 from any machine of 192.168.100.0/24


Here are the configs:

Server.Conf
------------
port 1193
proto udp
dev tun

tun-mtu 1500
fragment 1300
mssfix 1300

ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key # This file should be kept secret

dh /etc/openvpn/keys/dh1024.pem

server 192.168.123.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.1.0 255.255.255.0"

client-config-dir ccd
route 10.8.0.0 255.255.255.0

client-to-client
push "route 192.168.100.0 255.255.255.0"

push "redirect-gateway"

keepalive 10 120

comp-lzo
user nobody
group nobody
persist-key
persist-tun

status openvpn-status.log
log openvpn.log
verb 4
mute 10


Client conf
-----------
client
dev tun
proto udp
remote myIPAddress 1193
resolv-retry infinite
nobind

persist-key
persist-tun

ca /etc/openvpn/ca.crt
cert /etc/openvpn/afm3tserver.crt
key /etc/openvpn/afm3tserver.key

comp-lzo
verb 4
mute 10

tun-mtu 1500
fragment 1300
------------

How to browse the Internet using the Mozilla 1.x and Mozilla Firefox browsers

1. How to use tabs effectively

Tabs allow you to have several websites open in one browser window.

Press ctrl-t to create a new tab. The shortcut creates a new blank tab where you can open a new page and places the cursor in the location bar where you immediately can enter a URL address and press enter to view it. The address field can be accessed with the shortcut ctrl-l.

You can browse open tabs with ctrl-tab. You can also jump back and forth between tabs with ctrl-PgUp and ctrl-PgDn.

Tabs can be closed with ctrl-w. The shortcut does not work when the cursor is in the location bar, press tabulator if it is to jump down to the web page. Tabulator also allows you to select links on the web page, shift-tabulator jumps back to previous link.

2. Filtering away advertisements

2.1. Ignoring image advertisements with Mozilla 1.x

Open the settings dialog found at File -> Preferences and select Privacy & Security then Images. Here you can click Accept images that come from the originating server only. This effectively blocks a large number of advertisements because many sites use third party servers with the sole purpose of serving image ads.

Be aware that some sites actually serve images that are part of the normal content from different server addresses. If you find that this makes you miss out on important image content then choose Accept all images and use a different approach: Mozilla lets you right click on any image and select Block Images from this Server. By always doing this on all visible advertisements your browser will become virtually add-free within a week. The pr. site image permissions can be managed in the Privacy & Security -> Images dialog.

2.2. Firefox

Firefox also supports Block Images from when right clicking on images. Select Edit -> Preferences from the menu to get the settings dialog, then select Web Features to manage site image permissions. This dialog also allows you to only allow images for the originating Web site only.

2.3. Flash is the devil

The flash plug-in can be used to view some funny cartoons and play a few games. But the main use of flash today is serving very annoying advertisements.

The solution is simple: Install Flashblock

Flashblock replaces all flash animations with a play button. No flash content is loaded without you first approving by pressing this button. Simply genius.

3. Say no to Pop-Up Windows

Some rude websites create new windows with advertisements when you enter the site and sometimes when you leave the site. These windows are created automatically without your consent and cause you harm because you are forced to waste time closing them. Mozilla can stop this kind of pollution for you.

Mozilla 1.x:

  1. Select Edit -> Preferences from the menu
  2. Select the tab Privacy & Security -> Popup Windows
  3. Click Block unrequested popup windows

Mozilla Firefox:

  1. Select Edit -> Preferences from the menu
  2. Select the tab Web Features
  3. Click Block Popup Windows

4. What is Java-Script?

Java-Script is a scripting language that allows websites to open windows, change their focus, do math and other useful things. Web-shops use Java-Script to let you view the total amount on the fly, banks typically use Java-Script for a number of things and requires it to be supported and enabled.

Some sites must have Java-Script enabled to be used at all, other sites simply use it to display advertisement. The Google advertisement on the left of this page is displayed using Java-Script and is not shown in browsers without support it. This site, like many others, does not use Java-Script for any other purpose and you will only be missing links to related sites by browsing this site with Java-Script disabled.

A good strategy is to use two browsers, like Mozilla 1.x and Mozilla Firefox, and have one of them configured for general surfing and one for banks and other secure sites only. The browser for general purposes should have a strict security policy: Java-Script should be turned off, and websites should only be allowed to set session-cookies or be disallowed to set them at all. The other browser should be configured to allow Java-Script and perhaps allow some sites to set long-term cookies. You can archive this using a single browser by using different profiles for different purposes.

4.1. How to enable / disable Java-Script in Mozilla 1.x

Select Edit -> Preferences from the menu and Advanced -> Scripts & Plug-ins in the "preferences" dialog box.

4.2. How to enable / disable Java-Script in Firefox 9.x

Select Edit -> Preferences from the menu. Go to the Web Features tab.

There is a button "Advanced" where you can turn specific options on and off next toh the Enable Javascript checkbox.

5. What are cookies, any why do everyone want to give me one?

Cookies are small files used by websites to store information used while visiting and also to track your long-term movements on the net. A cookie is basically a file with strict limitations, it can only store a small piece of information and only the site who originally set the cookie is allowed to retrieve it later.

Cookies were originally intended to help creators of web services like web-shops keep track of orders and other relevant information during a purchase. Today cookies are mostly used by large media corporations to keep track of your movements and behavior on the web. Look at the cookie on the left. server-??.imrworldwide.com (where ?? is the country code, no, dk, uk..) is a evil global cooperation who will try to store cookies from all parts of the world until you eventually have added them all to your deny-list. The cookies this and other powerful corporations set when you visit a site where they provide advertisement back-end services serve no purpose beyond tracking your movements and purchasing behavior in order to show you more relevant messages.

Mozilla 1.x and Firefox has the ability to protect you against those who want to violate your privacy by storing long-term cookies with unnecessary information about you in cookies. You can ask your browser only to use and allow session cookies. This means websites can use cookies for honest purposes during a visit. All information set is cleared when you leave the site.

They also have the option of disallowing all cookies. This setting is good if you have a separate profile or browser dedicated to general entertainment surfing, but will quickly limit access to a few sites who really have no apparent reason for setting them at all.

I personally prefer using the ask-when-needed setting where you are asked to choose between "Allow, Allow for session and Deny" every time a website wants to store a cookie.

There is a box you can click to store the settings for a particular website permanent.

Some bloated commercial sites may ask you to set up to 10 different cookies originating from 10 different domains, typically ads.annoying-advertisements.com and similar. Let's say you occasionally need that site to set one cookie. If you use the ask option you can simply look at the Cookie box and make it remember that it should deny all those advertisement domains, but allow for session from the domain belonging to the site you are visiting.

5.1. Configuring cookie access in Mozilla 1.x

Select Edit -> Preferences from the menu, then Privacy & Security -> Cookies to get the dialog where you can cookie settings in Mozilla 1.x.

I personally recommend using the settings Allow cookies based on privacy settings and Ask for each cookie. Like when denying advertisement images, you will find that the major advertisement corporations will be on your deny-cookie-list after just a few weeks of surfing.

5.2. Configuring cookie access in Mozilla Firefox 9.x

Select Edit -> Preferences from the menu, then Privacy -> Cookies.

It is a good idea to turn on Enable cookies, turn on for the originating Web site only and Ask for each cookie.

Use Accept for current session only instead of Accept cookies normally if you never want to be bothered or asked about cookies. There is no real reason why web-sites should store information about you in a small file stored by your browser permanently.

6. How to use a unique profile depending on web site type

You can have several different user profiles in both Mozilla 1.x and Firefox.

Mozilla 1.x --help shows:

          -P             Start with .
-ProfileWizard Start with profile wizard.
-ProfileManager Start with profile manager.
-SelectProfile Start with profile selection dialog.

Firefox --help shows:

          -P             Start with .
-ProfileManager Start with profile manager.

You can make your menu start the browser with -P to get a dialog box where you can select profile when it is started. You can make new profiles and manage them by starting with the -ProfileManager parameter. It is generally a good idea to have one profile for bank and other important services and a standard profile for general surfing.

7. How to disable automatic plug-in installation

If you visit a page which requires a plug-in you do not have, Mozilla and Mozilla Firefox will pop-up an annoying box asking you to download and install it.

This is, for most people OK. But what if you do not want to install any more plug-ins?

Mozilla and Mozilla Firefox does not have an option for this, but there is a trick:

Remove the file libnullplugin.so from your plug-in folder! This makes your browser STFU about missing plug-ins.

Your plug-in folder is probably one of the following:

Mozilla:

  /usr/lib/mozilla/plugins/
/usr/local/lib/mozilla/plugins/

Mozilla Firefox:

  /usr/lib/MozillaFirefox/plugins/
/usr/local/lib/MozillaFirefox/plugins/

8. How to edit preferences not available through the configuration dialog

In Mozilla 1.x and Mozilla Firefox you can change all settings by typing in

about:config

in the url address bar. Here you can change things not available in the normal config dialog.

8.1. How to make the fonts look better

If Mozilla 1.x or Mozilla Firefox is compiled with --enable-xft (this is true on most distributions) then you can make the fonts look better by setting some hidden configuration options.

Enter about:config in the location address bar.

You will now get a list of all available options, even those not visible in the configuration dialog. Look for

  font.Freetype2.autohinted
font.Freetype2.enable

And set them both to true.

For more information:

Bitstream Vera fonts look good and are suitable as default fonts.

9. How to make Mozilla identify as Internet Explorer

Go to about:config and change:

   general.useragent.vendor
general.useragent.vendorSub

10. How to trim Mozilla 1.x

The Mozilla Browser (1.x series) has grown to become a complete Web Suite complete with a

  • browser
    • ctrl+1
  • html-editor
    • ctrl+e to edit viewed page, ctrl+shift+n to start editing from a blank page),
  • mail and news reader
    • ctrl+2
  • irc-client,
  • calendar program -ctrl+8,
  • address book
    • ctrl+5

You may not like some of these components. If you know how to compile software or use a Linux distribution with USE flags that allow you to configure your software as preferred you can signifficantly speed up Mozillas initial loading time by removing the unimportant parts and libraries.

10.1. Gentoo wins

Gentoo Linux users can choose between these USE flags when installing net-www/mozilla:

crypt debug gnome gtk2 ipv6 java ldap mozcalendar moznocompose moznoirc moznomail moznoxft mozsvg ssl xinerama xprint

Be aware, you will need the actual libraries for the support to work. ./configure will fail or omit libraries where the right headers are not found. Gentoo users can experiment with use on the command line (USE="ipv6 gtk" emerge -pv mozilla) to determine what new libraries will be installed as a consequence of various flags.

Library support:

  • crypt - Add support for encryption -- using mcrypt or gpg where applicable
  • debug - Bulid the package with debugging support
  • gnome - Adds GNOME support
  • gtkhtml - Adds support for gnome-extra/gtkhtml
  • gtk2 - Use gtk+ v2 over gtk+ v1 in cases where a program supports both. This is something you want, and not only for Mozilla.
  • ipv6 - Get with the program, IPv6 is old news already.
  • java - Adds support for Java
  • ldap - Adds LDAP support (Lightweight Directory Access Protocol)
  • ssl - Adds support for Secure Socket Layer connections
  • xinerama - Add support for the xinerama X11 extension, which allows you to stretch your display across multiple monitors

10.2. Compiling the hard way

Now, the actual parts of Mozilla

Gentoo USE ./configure --enable/disable- ?
mozcalendar (enable) calendar Mozilla calendar extension
moznocompose (disable) composer Mozilla's html editor / web page composer
moznoirc (disable) irc Mozilla's IRC client
moznomail (disable) mailnews Mozilla's mail client
moznoxft (disable) xft You need XFT support in mozilla (also firefox, thunderbird)
mozsvg (enable) svg Support for SVG graphics
xprint (enable) xprint xprint support for printing in mozilla (also firefox, thunderbird),

Gentoo users can place the USE flags in the file /etc/portage/package.use like this:

net-www/mozilla crypt -debug gnome gtk2 ipv6 java ldap mozcalendar -moznocompose moznoirc moznomail -moznoxft mozsvg ssl xinerama xprint

Or install a plain Mozilla like this (later emerges will use default use flags, the USE setting will be used for this emerge only):

USE="crypt -debug -gnome gtk2 ipv6 -java -ldap -mozcalendar moznocompose moznoirc moznomail -moznoxft mozsvg ssl xinerama xprint" emerge mozilla

Only experienced users should attempt to compile Mozilla from the command line like this:

./configure --enable-toolkit-gtk2 --enable-default-toolkit=gtk2 --disable-toolkit-qt --disable-toolkit-xlib --disable-toolkit-gtk --enable-xft --disable-calendar --disable-composer --disable-irc --disable-mailnews && make

Some hints on compiling Mozilla (./configure && make && make install)

You should use gtk2 to compile Mozilla. Enable it with these flags:

   --enable-toolkit-gtk2
--enable-default-toolkit=gtk2
--disable-toolkit-qt
--disable-toolkit-xlib
--disable-toolkit-gtk
--enable-xft

It is extremely important to make sure you are getting xft support.

It is also possible to use gtk:

   --enable-toolkit-gtk
--enable-default-toolkit=gtk
--disable-toolkit-qt
--disable-toolkit-xlib
--disable-toolkit-gtk2

Beginners: Learn Linux

1. What is Linux?

Linux is a free Unix-type operating system for computer devices. The operating system is what makes the hardware work together with the software. The OS is the interface that allows you to do the things you want with your computer. Linux is freely available to everyone. OS X and Windows are other widely used OS.

Linux gives you a graphical interface that makes it easy to use your computer, yet it still allows those with know-how to change settings by adjusting 0 to 1.

It is only the kernel that is named Linux, the rest of the OS are GNU tools. A package with the kernel and the needed tools make up a Linux distribution. Mandrake , Suse, Gentoo and Redhat are some of the many variants. Linux OS can be used on a large number of boxes, including i386+ , Alpha, PowerPC and Sparc.

2. Understanding files and folders

Linux is made with one thought in mind: Everything is a file.

A blank piece of paper is called a file in the world of computers. You can use this piece of paper to write a text or make a drawing. Your text or drawing is called information. A computer file is another way of storing your information.

If you make many drawings then you will eventually want to sort them in different piles or make some other system that allows you to easily locate a given drawing. Computers use folders to sort your files in a hieratic system.

A file is an element of data storage in a file system (file systems manual page). Files are usually stored on harddrives, cdroms and other media, but may also be information stored in RAM or links to devices.

To organize our files into a system we use folders. The lowest possible folder is root / where you will find the user homes called /home/.

  /
/home/
/home/mom/
/home/dad/

Behind every configurable option there is a simple human-readable text file you can hand-edit to suit your needs. These days most programs come with nice GUI (graphical user interface) like Mandrakes Control Center and Suses YAST that can smoothly guide you through most configuration. Those who choose can gain full control of their system by manually adjusting the configuration files from foo=yes to foo=no in an editor.

Almost everything you do on a computer involves one or more files stored locally or on a network.

Your filesystems lowest folder root / contains the following folders:

/bin Essential user command binaries (for use by all users)
/boot Static files of the boot loader, only used at system startup
/dev Device files, links to your hardware devices like /dev/sound, /dev/input/js0 (joystick)
/etc Host-specific system configuration
/home User home directories. This is where you save your personal files
/lib Essential shared libraries and kernel modules
/mnt Mount point for a temporarily mounted filesystem like /mnt/cdrom
/opt Add-on application software packages
/usr /usr is the second major section of the filesystem. /usr is shareable, read-only data. That means that /usr should be shareable between various FHS-compliant hosts and must not be written to. Any information that is host-specific or varies with time is stored elsewhere.
/var /var contains variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.
/proc System information stored in memory mirrored as files.

The only folder a normal user needs to use is /home/you/ - this is where you will be keeping all your documents.

  /home/elvis/Documents
/home/elvis/Music
/home/elvis/Music/60s

Files are case sensitive, "myfile" and "MyFile" are two different files.

For more details, check out:

3. Understanding users and permissions

Linux is based on the idea that everyone using a system has their own username and password.

Every file belongs to a user and a group, and has a set of given attributes (read, write and executable) for users, groups and all (everybody).

A file or folder can have permissions that only allows the user it belongs to to read and write to it, allowing the group it belongs to to read it and at the same time all other users can't even read the file.

4. Who and what is root

Linux has one special user called root (this is the user name). Root is the "system administrator" and has access to all files and folders. This special user has the right to do anything.

You should never log on as this user unless you actually need to do something that requires it!

Use su - to temporary become root and do the things you need, again: never log into your sytem as root!

Root is only for system maintenance, this is not a regular user (LindowsOS don't have any user management at all and uses root for everything, this is a very bad idea!).

You can execute a command as root with:

su -c 'command done as root'

Gentoo Linux: Note that on Gentoo Linux only users that are member of the wheel group are allowed to su to root.

5. Opening a command shell / terminal

To learn Linux, you need to learn the shell command line in a terminal emulator.

In KDE: K -> System -> Konsoll to get a command shell)

Pressing CTRL-ALT-F1 to CTRL-ALT-F6 gives you the console command shell windows, while CTRL-ALT-F7 gives you XFree86 (the graphical interface).

xterm (manual page) is the standard XFree console installed on all boxes, run it with xterm (press ALT F2 in KDE and Gnome to run commands).

Terminals you probably have installed:

Non-standard terminals should install:

6. Your first Linux commands

Now you should have managed to open a terminal shell and are ready to try your first Linux commands. Simply ask the computer to do the tasks you want it to using it's language and press the enter key (the big one with an arrow). You can add a & after the command to make it run in the background (your terminal will be available while the job is done). It can be practical to do things like moving big divx movies as a background process: cp movie.avi /pub &. Jobs - the basics of job control

6.1. ls - short for list

ls lists the files in the current working folder. This is probably the first command to try out. It as a number of options described on the ls manpage.

Examples:

ls

ls -al --color=yes

6.2. pwd - print name of current/working directory

pwd prints the fully resolved name of the current (working) directory. pwd manpage.

6.3. cd - Change directory

cd stands for change (working) directory and that's what it does. The folder below you (unless you are in /, where there is no lower directory) is called "..".

To go one folder down:

cd ..

Change into the folder Documents in your current working directory:

cd Documents

Change into a folder somewhere else:

cd /pub/video

The / in front of pub means that the folder pub is located in the / (lowest folder).

7. The basic commands

7.1. chmod - Make a file executable

To make a file executable and runnable by any user:

chmod a+x myfile

Refer to the chmod manual page for more information.

7.2. df - view filesystem disk space usage

df -h

  Filesystem Size  Used Avail Use% Mounted on
/dev/hda3 73G 67G 2.2G 97% /
tmpfs 2.0M 24K 2.0M 2% /mnt/.init.d
tmpfs 252M 0 252M 0% /dev/shm

The flags: -h, --human-readable Appends a size letter such as M for megabytes to each size.

df manpage

7.3. du - View the space used by files and folders

Use du (Disk Usage) to view how much space files and folders occupy. Read the du manual page for flags and usage.

du is a part of fileutils.

Example du usage:

  du -sh Documents/
409M Documents

7.4. mkdir - makes folders

Folders are created with the command mkdir:

mkdir folder

To make a long path, use mkdir -p :

mkdir -p /use/one/command/to/make/a/long/path/

Like most programs mkdir supports -v (verbose). Practical when used in scripts.

You can make multiple folders in bash and other shells with {folder1,folder2} :

mkdir /usr/local/src/bash/{old,new,dist,bugs}

mkdir manual page

The command rmdir removes folders.

7.5. passwd - changes your login password

To change your password in Linux, type:

passwd

The root user can change the password of any user by running passwd with the user name as argument:

passwd jonny

will change jonnys password. Running passwd without arguments as root changes the root password.

If you need to add several new users and give them password you can use a handy program like Another Password Generator to generate a large set of "random" passwords.

7.5.1. KDE

From KDE you can change your password by going:

  • K -> Settings -> Change Password
  • K -> Settings -> Control Center -> System Administration -> User Account

7.6. rm - delete files and folders, short for remove

Files are deleted with the command rm:

  rm /home/you/youfile.txt

To delete folders, use rm together with -f (Do not prompt for confirmation) and -r (Recursively remove directory trees):

  rm -rf /home/you/foo/

Like most programs rm supports -v (verbose).

rm manual page

7.7. ln - make symbolic links

A symbolic link is a "file" pointing to another file.

To make a symbolic link :

  ln /original/file /new/link

This makes /original/file and /new/link the same file - edit one and the other will change. The file will not be gone until both /original/file and /new/link are deleted.

You can only do this with files. For folders, you must make a "soft" link.

To make a soft symbolic link :

  ln -s /original/file /new/link

Example:

  ln -s /usr/src/linux-2.4.20 /usr/src/linux

Note that -s makes an "empty" file pointing to the original file/folder. So if you delete the folder a symlink points to, you will be stuck with a dead symlink (just rm it).

ln manual page

7.8. tar archiving utility - tar.bz2 and tar.gz

tar (manual page) is a very handle little program to store files and folders in archives, originally made for tapestreamer backups. Tar is usually used together with gzip (manual page) or bzip2 (manual page), comprepssion programs that make your .tar archive a much smaller .tar.gz or .tar.bz2 archive.

kde

You can use the program ark (K -> Utilities -> Ark) to handle archives in KDE. Konqueror treats file archives like normal folders, simply click on the archive to open it. The archive becomes a virtual folder that can be used to open, add or remove files just as if you were working with a normal folder.

7.8.1. tar files (.tar.gz)

To untar files:

  tar xvzf file.tar.gz

To tar files:

  tar cvzf file.tar.gz filedir1 filedir2 filedir2...

Note: A .tgz file is the same as a .tar.gz file. Both are also often refered to as tarballs.

The flags: z is for gzip, v is for verbose, c is for create, x is for extract, f is for file (default is to use a tape device).

7.8.2. bzip2 files (.tar.bz2)

To unpack files:

  tar xjvf file.tar.bz2

To pack files:

  tar cvjf file.tar.bz2 filedir1 filedir2 filedir2...

The flags: Same as above, but with j for for bzip2

You can also use bunzip2 file.tar.bz2 , will turn it into a tar.

For older versions of tar, try tar -xjvf or -xYvf or -xkvf to unpack.There's a few other options it could be, they couldn't decide which switch to use for bzip2 for a while.

How to untar an entire directory full or archives?

.tar:

for i in `ls *.tar`; do tar xvf $i; done

.tar.gz: for i in `ls *.tar.gz`; do tar xvfz $i; done

.tar.bz2: for i in `ls *.tar.bz2`; do tar xvfj $i; done

Thursday, July 31, 2008

Create a Custom Live Linux CD - Leveraging BusyBox and OpenSSH

by Mike Chirico

These steps will show you how to create a functioning Linux system, with the latest 2.6 kernel compiled from source, and how to integrate the BusyBox utilities including the installation of DHCP. Plus, how to compile in the OpenSSH package. The system will have full ssh capabilities. The techniques for compiling and installing software can be universally applied to your own packages. So, once you understand the process, you are free to recreate your own system -- there is a lot of free space.

On system boot-up a filesystem will be created and the contents from the CD will be uncompressed and completely loaded into RAM -- the CD could be removed at this point for boot-up on a second computer. You can take over any PC assuming you have configured the kernel with the appropriate drivers and the PC can boot from a CD.


QUICK INSTALL: Confirmation that Everything Works - Before Rolling You Own


Quick step 1:

Download "cdrom_linux_boot_proj1.iso" and burn this iso on your cdrom. Next, reboot the system. This is a check to see if the current kernel has been compiled with the necessary network, video, and keyboard (USB included) drivers. If critical drivers are not recognized they can be added into the kernel.

Quick step 2:

Download the complete project environment "proj1.tar.gz." This includes everything used to build and customize "cdrom_linux_boot_proj1.iso", including the BusyBox source, libraries, and ssh. The directory "_install" contains the necessary libraries for ssh, init and tcpdump. The 2.6.11 kernel ".config" can be found in the documents directory. The staging area contains a copy of the kernel bzImage, along with the isolinux boot loader. The "proj1.tar.gz" file is about 13M, since it includes everything you need, except the kernel source, which can be downloaded from the following link:

http://www.kernel.org/pub/linux/kernel/v2.6/

Step 8 covers the configuration and installation of the latest kernel. At this stage, download the project environment "proj1.tar.gz" from the following link:

http://prdownloads.sourceforge.net/souptonuts/proj1.tar.gz

You must "tar -xzf" this file as root to get all the necessary character and block devices. Standard user accounts cannot create all the necessary block and character devices that will be needed. Try "tar -xzf" under an account without root privileges to see the differences in the files created under "_install/dev".

If you're curious about the difference between character devices and block devices, you may want to reference the Linux Journal article

http://www.linuxjournal.com/article/2890

In summary, only block devices can mount filesystems. But character devices, such as a tape drive can contain data found on a block device.

Checking the download:

a. Check the md5sum to make sure you got the full copy, then, "tar -xzf" the package.

              $ md5sum proj1.tar.gz

b. Now as root, so that you will get all "dev/" devices, execute the following command.

              [Must be done as root]
$ su -
# cd
# tar -xzf proj1.tar.gz

If you did the above as root, then you should have the following:

                [root@third-fl-71 _install]# ls -l dev
total 8
crw------- 1 root root 5, 1 Feb 25 20:41 console
lrwxrwxrwx 1 root root 11 Mar 6 09:22 core -> /proc/kcore
brw-rw-rw- 1 root floppy 2, 0 Feb 20 17:37 fd0
brw-rw---- 1 root disk 3, 0 Mar 5 04:32 hda
brw-rw---- 1 root disk 3, 1 Mar 5 20:37 hda1
brw-rw---- 1 root disk 3, 2 Mar 5 20:38 hda2
brw-rw---- 1 root disk 3, 3 Mar 5 21:02 hda3
brw-rw---- 1 root disk 3, 4 Mar 5 21:02 hda4
drwxr-xr-x 2 root root 4096 Mar 5 21:13 mapper
crw-rw-rw- 1 root root 1, 3 Feb 20 17:37 null
crw-rw-rw- 1 root tty 5, 2 Feb 26 12:54 ptmx
drwxr-xr-x 2 root root 4096 Mar 4 05:33 pts
brw------- 1 root disk 1, 0 Feb 20 17:37 ram0
brw-rw-rw- 1 root disk 1, 1 Feb 20 17:37 ram1
brw-rw-rw- 1 root disk 1, 2 Feb 20 17:37 ram2
brw-rw-rw- 1 root disk 1, 3 Feb 20 17:37 ram3
crw-rw-rw- 1 root root 1, 8 Feb 26 03:23 random
brw-rw---- 1 root disk 8, 0 Mar 5 04:32 sda
brw-rw---- 1 root disk 8, 1 Mar 5 04:32 sda1
brw-rw---- 1 root disk 8, 2 Mar 5 04:32 sda2
brw-rw---- 1 root disk 8, 3 Mar 5 21:02 sda3
brw-rw---- 1 root disk 8, 4 Mar 5 21:02 sda4
lrwxrwxrwx 1 root root 15 Mar 6 09:22 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Mar 6 09:22 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Mar 6 09:22 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root 5, 0 Feb 21 18:32 tty
crw-rw-rw- 1 root root 4, 0 Feb 20 17:37 tty0
crw-rw-rw- 1 root root 4, 1 Feb 20 22:38 tty1
crw-rw-rw- 1 root root 4, 2 Feb 26 08:24 tty2
crw-rw-rw- 1 root root 4, 3 Feb 26 08:24 tty3
crw-rw-rw- 1 root root 4, 4 Feb 26 08:24 tty4
crw-rw-rw- 1 root root 4, 5 Feb 26 08:24 tty5
crw------- 1 root root 4, 6 Mar 1 19:34 tty6
crw-rw---- 1 root root 4, 7 Mar 1 14:33 tty7
crw-rw---- 1 root root 4, 8 Mar 1 14:33 tty8
crw-rw---- 1 root tty 4, 9 Mar 1 14:33 tty9
cr--r--r-- 1 root root 1, 9 Feb 26 03:23 urandom
crw------- 1 vcsa tty 7, 0 Mar 1 14:33 vcs
crw-rw-rw- 1 root root 1, 5 Feb 26 03:23 zero

If you repeat the steps above using a standard account, a lot of the files will be missing.

c. Take a look at the file "proj1/createiso". This will create a filesystem on a loop back device with the mount point "./cdrom". Copy the contents of "_install", which has already been compiled with the necessary busybox code. Once it is copied, umount "./cdrom" so that it can be compressed. This will then get copied to the staging area where "mkisofs" will create a bootable CD image. The boot loader isolinux, along with the needed config files can be found in "proj1/staging_iso_image/boot/isolinux/"

There is a bash script "createiso" that performs the above tasks.

               $ cd proj1
$ su
# ./createiso

Take a look at "createiso". This bash script creates a virtual filesystem. For details on creating a virtual filesystem reference the following article on Freshmeat [ http://freshmeat.net/articles/view/1387/ ]

COMPREHENSIVE TUTORIAL: Building Everything from Downloaded Source

You may want to keep the results of the quick install steps above in a separate directory to compare against the completion of each step below.

STEP 1: Download BusyBox

Download BusyBox (http://www.busybox.net/downloads/). These examples were created with http://www.busybox.net/downloads/busybox-1.00.tar.gz.

  $ wget http://www.busybox.net/downloads/busybox-1.00.tar.gz
$ wget http://www.busybox.net/downloads/busybox-1.00.tar.gz.sign
$ md5sum busybox-1.00.tar.gz
fa62459e098fc00b22772aaf2e75bc98 busybox-1.00.tar.gz
Next expand the files:
  $ tar -xzf busybox-1.00.tar.gz

Note if you want to verify Erik's key:

  $ wget http://codepoet.org/andersen/erik/gpg.asc
$ gpg --import gpg.asc
$ gpg --verify busybox-1.00.tar.gz.sign

Now look inside busybox-1.00.tar.gz.sign for the md5sum. Note, he has done it differently than it's done with the 2.6 kernel (reference step 9).


STEP 2: Configuring BusyBox

You may want to download my config for BusyBox and rename it to ".config". I have the needed features turned on.

My config download can be found here: http://prdownloads.sourceforge.net/souptonuts/chiricobusybox.config

  $ cd busybox-1.00

[Note you may need to select another mirror]
$ wget http://osdn.dl.sourceforge.net/sourceforge/souptonuts/chiricobusybox.config
$ cp chiricobusybox.config .config

You should take a look at the options that I have set by running "make menuconfig" or take a look at "chiricobusybox.config" directly.

  $ make menuconfig

In particular, "Support version 2.6.x Linux kernels" is checked. Under "Login/Password Management Utilities" everything is checked EXCEPT "Use internal password and group functions". Note, at this stage you do NOT want to select this option because "/etc/passwd", "/etc/shadow" and "/etc/shadow-", will be copied to the "_install/etc" directory, and used instead.

Also, "lsmod", "modprobe", "rmmod" are checked. Although not essential for the initial build, this system you are building will support networking. You may eventually want to scp in modules and load them, once you get the system running, of course. There is plenty of space for these modules.

After taking a look at ".config", run "make" and "make install", which by default will install everything under "_install".

  $ make
$ make install

During the final stages of "make install" the following message will be displayed.

  --------------------------------------------------
You will probably need to make your busybox binary
setuid root to ensure all configured applets will
work properly.
--------------------------------------------------

The next command must be executed after each "make install" to setuid root on the BusyBox binary.

  $ chmod 4755 ./_install/bin/busybox


STEP 3: Needed Directories

Several directories need to be created under "_install". Take a look at the current contents.

  $ cd _install
$ ls
bin linuxrc sbin usr

Next create "dev" for "device entries", which will be populated later, "etc", "lib", "proc", "tmp", "var" and "sys" with the following commands.

  $ mkdir -p dev sys etc/init.d lib proc tmp var/lib/misc var/lock var/log var/run var/tmp
$ chmod 1777 tmp
$ chmod 1777 var/tmp


STEP 4: Device Entries

The "dev" directory needs to be populated with device entries. They can either be copied from the current system or created with the "mknod -m " command. The following will have to be done as root.

Since there are a lot of files, and you may want to rebuild you "_install", it is recommended that these be put in a file. Below the file createdev is created with the following contents:

  #!/bin/bash
# put this in a file called createdev
#
cp -avp /dev/console dev
cp -avp /dev/core dev
cp -avp /dev/fd0 dev
cp -avp /dev/null dev
cp -avp /dev/ptmx dev
cp -avp /dev/pts dev
cp -avp /dev/ram0 dev
cp -avp /dev/ram1 dev
cp -avp /dev/ram2 dev
cp -avp /dev/ram3 dev
cp -avp /dev/random dev
cp -avp /dev/stderr dev
cp -avp /dev/stdin dev
cp -avp /dev/stdout dev
cp -avp /dev/tty dev
cp -avp /dev/tty0 dev
cp -avp /dev/tty1 dev
cp -avp /dev/tty2 dev
cp -avp /dev/tty3 dev
cp -avp /dev/tty4 dev
cp -avp /dev/tty5 dev
cp -avp /dev/tty6 dev
cp -avp /dev/tty7 dev
cp -avp /dev/tty8 dev
cp -avp /dev/tty9 dev
cp -avp /dev/urandom dev
cp -avp /dev/vcs dev
cp -avp /dev/zero dev

Now run the command, as root, in "_install"

  $ su
# pwd
/home/chirico/busybox/busybox-1.00/_install

# chmod 700 createdev
# ./createdev

The "ls -al" command now shows the following contents.

  # ls -l dev
total 4
crw------- 1 root root 5, 1 Feb 17 14:49 console
crw------- 1 root root 1, 6 Jan 30 2003 core
brw-rw---- 1 root floppy 2, 0 Jan 30 2003 fd0
crw-rw-rw- 1 root root 1, 3 Jan 30 2003 null
crw-rw-rw- 1 root root 5, 2 Mar 5 17:16 ptmx
drwxr-xr-x 2 root root 4096 Feb 17 09:48 pts
brw-rw---- 1 root disk 1, 0 Jan 30 2003 ram0
brw-rw---- 1 root disk 1, 1 Jan 30 2003 ram1
brw-rw---- 1 root disk 1, 2 Jan 30 2003 ram2
brw-rw---- 1 root disk 1, 3 Jan 30 2003 ram3
crw-r--r-- 1 root root 1, 8 Jan 30 2003 random
lrwxr-xr-x 1 root root 17 Mar 5 17:16 stderr -> ../proc/self/fd/2
lrwxr-xr-x 1 root root 17 Mar 5 17:16 stdin -> ../proc/self/fd/0
lrwxr-xr-x 1 root root 17 Mar 5 17:16 stdout -> ../proc/self/fd/1
crw-rw-rw- 1 root root 5, 0 Mar 3 21:20 tty
crw--w---- 1 root root 4, 0 Jan 30 2003 tty0
crw------- 1 root root 4, 1 Feb 17 14:49 tty1
crw------- 1 root root 4, 2 Feb 17 14:49 tty2
crw------- 1 root root 4, 3 Feb 17 14:49 tty3
crw------- 1 root root 4, 4 Feb 17 14:49 tty4
crw------- 1 root root 4, 5 Feb 17 14:49 tty5
crw------- 1 root root 4, 6 Feb 17 14:49 tty6
crw--w---- 1 root root 4, 7 Oct 24 2003 tty7
crw--w---- 1 root root 4, 8 Jan 30 2003 tty8
crw--w---- 1 root tty 4, 9 Jan 30 2003 tty9
crw-r--r-- 1 root root 1, 9 Feb 17 14:49 urandom
crw--w---- 1 vcsa tty 7, 0 Jan 30 2003 vcs
crw-rw-rw- 1 root root 1, 5 Jan 30 2003 zero

These files could all have been created with the "mknod" command. Taking a look at "tty" above, about half way down, it is a character device with a major number of 5 and a minor number of 0. It has rights rw-rw-rw. So the "tty" device could have been created with the command "mknod -m 666 dev/tty c 5 0" . But, you ask, where can you get a listing of all the major and minor numbers for both block and character devices? This can be found in "/Documentation/devices.txt" in the kernel source. Or, you can see them all here: http://souptonuts.sourceforge.net/devices.txt

So, if you want to mount disk drives, ide (hda) and scsi (sda) consider executing the following commands:

  mknod -m 660 dev/hda  b 3 0
mknod -m 660 dev/hda1 b 3 1
mknod -m 660 dev/hda2 b 3 2
mknod -m 660 dev/hda3 b 3 3
mknod -m 660 dev/hda4 b 3 4
chown root.disk dev/hda*

mknod -m 660 dev/sda b 8 0
mknod -m 660 dev/sda1 b 8 1
mknod -m 660 dev/sda2 b 8 2
mknod -m 660 dev/sda2 b 8 3
mknod -m 660 dev/sda2 b 8 4
chown root.disk dev/sda*

After the PC is booted from the CD, you can mount these devices after creating a directory as the mount point "mkdir /h", then, it gets mounted as "mount -t ext2 /dev/hda2 /h".

It is also possible to create volume groups

  mkdir -p dev/mapper
mknod -m 600 dev/mapper/VolGroup00-LogVol00 b 253 0
mknod -m 600 dev/mapper/VolGroup00-LogVol01 b 253 1
chown -R root.root dev/mapper

Create a directory "/v1"

  mkdir -p /v1

The VolGroup would be mounted as ext3, most likely by doing the following after creating a mount point "/v1", then, "mount -t ext3 /dev/VolGroup00/LogVol01 /v1". But, would require the proper device drivers to be loaded in the kernel module, and the needed configuration in "/etc/rc.sysinit", notably the section under "# LVM2 initializtion". All of this will be discussed in a future update of this article.


STEP 5: Needed Files and Directories (files and directories in "etc" and "var")

Create the necessary files in "etc". Exit out of root at this point, so that there is no chance of over-writing you system "/etc" -- note disaster is only a "/" away. WARNING: Never copy anything into a directory that starts with "/", since that is your current running system.

  [Exit out of root]

The "etc/passwd" file is shown below. Since the ssh daemon will run, an account will be created for it. Note for sshd that login is set to "/bin/false"

  [etc/passwd]
root:x:0:0:Linux User,,,:/root:/bin/sh
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/bin/false

Below "root" and "sshd" have been added to the group.

  [etc/group]
root:x:0:root
sshd:x:74:

Note below that there is a password for the account root. This encrypted password is "root". You could create your own password here by copying an existing account password from "/etc/shadow" and "/etc/shadow-". The account "sshd" should have "*" for the password.

  [etc/shadow]
root:$1$$oCLuEVgI1iAqOA8pwkzAg1:12439:0:99999:7:::
sshd:*:11880:0:99999:7:-1:-1:0


[etc/shadown-]
root:$1$$hCYnkWaG0VVCE9xJiIJwU/:12439:0:99999:7:::
sshd:*:11880:0:99999:7:-1:-1:0

Interesting question regarding sshd: Why is "/dev/pts" necessary when sshing into this computer? If you are uncertain, remove this line and observe the results of the command "ps aux", when attempting to ssh in.

  [etc/fstab]
/dev/ram0 / ext2 defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0

The file "etc/inittab" is called by the init program. There are no run levels with BusyBox. The lines "tty2::respawn:/sbin/getty 38400 tty2" allow you to enter "ctl-alt-F2" and get a login screen.

  [etc/inittab]
# This is run first except when booting in single-user mode.
#
::sysinit:/etc/init.d/rcS
#
#
::respawn:/sbin/getty 38400 tty1
#
# /sbin/getty invocations for selected ttys
#
#tty1::respawn:/sbin/getty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
tty5::respawn:/sbin/getty 38400 tty5
tty6::respawn:/sbin/getty 38400 tty6
tty7::respawn:/sbin/getty 38400 tty7
tty8::respawn:/sbin/getty 38400 tty8
tty9::respawn:/sbin/getty 38400 tty9
#
#
# Example of how to put a getty on a serial line (for a terminal)
#
#::respawn:/sbin/getty -L ttyS0 9600 vt100
#::respawn:/sbin/getty -L ttyS1 9600 vt100
#
# Example how to put a getty on a modem line.
#::respawn:/sbin/getty 57600 ttyS2
#
# Stuff to do when restarting the init process
::restart:/sbin/init
#
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a

Note above, "inittab" calls "etc/init.d/rcS". The ram drive must be remounted; otherwise, it will be read only. Also, when the system boots, DHCP will be enabled. If the computer is not going to be connected to the network, comment this out, since it will repeatedly attempt to acquire an IP address. Also, if the proper NIC (Network Interface Card) is not found, you will inundated with messages.

  [etc/init.d/rcS]
#!/bin/sh
/bin/mount -a
# below getting rid of ram being mounted ro
/bin/mount -o remount /
#
# The following is for dhcp
#
ifconfig eth0 0.0.0.0
/sbin/udhcpc
#
# Instead, if you want static IP address
#
#ifconfig eth0 192.168.1.13 netmask 255.255.252.0
#route add default gw 192.168.1.1
#
# Run ssh daemon
/sbin/sshd

The file below, along with libraries /lib/libnss_* are necessary for password authentication, since the recent version of GNU Libc (glibc) uses Name Service Switch (NSS). This file can probably be copied from your system's "/etc/nsswitch.conf" file. If you don't have this file on your system, take the necessary files from "proj1.tar.gz".

  [etc/nsswitch.conf]
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
# nisplus or nis+ Use NIS+ (NIS version 3)
# nis or yp Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# db Use the local database (.db) files
# compat Use NIS on compat mode
# hesiod Use Hesiod for user lookups
# [NOTFOUND=return] Stop searching if not found so far
#
# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis
passwd: files
shadow: files
group: files
#hosts: db files nisplus nis dns
hosts: files dns
# Example - obey only what nisplus tells us...
#services: nisplus [NOTFOUND=return] files
#networks: nisplus [NOTFOUND=return] files
#protocols: nisplus [NOTFOUND=return] files
#rpc: nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files
bootparams: nisplus [NOTFOUND=return] files
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files
netgroup: files
publickey: nisplus
automount: files
aliases: files nisplus

This file contains device names that permit root logins. For now, it makes sense for root to have lots of capabilities, for testing. "vc/1","vc/2" stands for virtual consoles.

  [etc/securetty]
console
tty
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty0
tty1
tty2
tty3
tty4
tty5
tty6

Below is a minimal hosts file. If you are running on a local LAN without a DNS server, then, add in additional names. Note, if you ping localhost and get nothing, then, lo may need to be configured: "ifconfig lo 127.0.0.1". If you are not sure what is defined where "ifconfig" will give you a listing.

  [etc/hosts]
127.0.0.1 localhost
# Additional names can be added
#192.168.1.106 squeezel

This is BusyBox's minimal conf.

  [etc/busybox.conf]
[SUID]
su = ssx root.0 # applet su can be run by anyone and runs with euid=0/egid=0
su = ssx # exactly the same

The following is used for acquiring an IP address via dhcp. The important setting here is the interface, which should be set to "eth0". The script that gets run "_install/usr/share/udhcpc/default.script" is the default BusyBox script for acquiring a dhcp address. Note, "etc/init.d/rcS" runs "/sbin/udhcpc", on bootup. You could remove this and assign a static IP address instead.

  [etc/udhcpd.conf]
# Sample udhcpd configuration file (/etc/udhcpd.conf)
# The start and end of the IP lease block
# The interface that udhcpd will use
interface eth0 #default: eth0
# The maximim number of leases (includes addressesd reserved
# by OFFER's, DECLINE's, and ARP conficts
#max_leases 254 #default: 254
# If remaining is true (default), udhcpd will store the time
# remaining for each lease in the udhcpd leases file. This is
# for embedded systems that cannot keep time between reboots.
# If you set remaining to no, the absolute time that the lease
# expires at will be stored in the dhcpd.leases file.
#remaining yes #default: yes
# The time period at which udhcpd will write out a dhcpd.leases
# file. If this is 0, udhcpd will never automatically write a
# lease file. (specified in seconds)
#auto_time 7200 #default: 7200 (2 hours)
# The amount of time that an IP will be reserved (leased) for if a
# DHCP decline message is received (seconds).
#decline_time 3600 #default: 3600 (1 hour)
# The amount of time that an IP will be reserved (leased) for if an
# ARP conflct occurs. (seconds
#conflict_time 3600 #default: 3600 (1 hour)
# How long an offered address is reserved (leased) in seconds
#offer_time 60 #default: 60 (1 minute)
# If a lease to be given is below this value, the full lease time is
# instead used (seconds).
#min_lease 60 #defult: 60
# The location of the leases file
#lease_file /var/lib/misc/udhcpd.leases #defualt: /var/lib/misc/udhcpd.leases
# The location of the pid file
#pidfile /var/run/udhcpd.pid #default: /var/run/udhcpd.pid
# Everytime udhcpd writes a leases file, the below script will be called.
# Useful for writing the lease file to flash every few hours.
#notify_file #default: (no script)
#notify_file dumpleases # <--- usefull for debugging
# The following are bootp specific options, setable by udhcpd.
#siaddr 192.168.0.22 #default: 0.0.0.0
#sname zorak #default: (none)
#boot_file /var/nfs_root #default: (none)
# The remainer of options are DHCP options and can be specifed with the
# keyword 'opt' or 'option'. If an option can take multiple items, such
# as the dns option, they can be listed on the same line, or multiple
# lines. The only option with a default is 'lease'.

Copying utmp for the "who" command.

  $ cd proj1/_install/var/run/
$ cp -pav /var/run/utmp .


STEP 6: Libraries

This configuration uses GNU Libc (glibc). In contrast, "uClibc" is smaller and easier to setup with ssh, since ssh or any program that makes a C call to "getpwname" will fail under glibc, if the appropriate Name Service Switch (NSS) files are not copied. Specifically, "/etc/nsswitch.conf", and "/lib/libnss_*" must be copied. Otherwise, runing the simple ssh command will produce the following error:

  $ ssh
you don't exist, go away!

You will get this error even if you have "etc/passwd", "etc/shadow",and "etc/shadow-", because getpwname cannot extract the correct values from "passwd". Here is a sample program to test this behavior. Reference the following program "getpwuid.c" in the following link [ http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz ] if you are curious about this behavior.

For the most part, you can find which libraries are dynamically linked into a program by issuing the "ldd" command. Try this on your own system.

  $ ldd /usr/bin/ssh
libcrypto.so.4 => /lib/libcrypto.so.4 (0x003b8000)
libutil.so.1 => /lib/libutil.so.1 (0x00dee000)
libz.so.1 => /usr/lib/libz.so.1 (0x00827000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00d9b000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x06182000)
libselinux.so.1 => /lib/libselinux.so.1 (0x00db3000)
libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00d28000)
libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00c95000)
libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00cfc000)
libcom_err.so.2 => /lib/libcom_err.so.2 (0x00c90000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00966000)
libc.so.6 => /lib/tls/libc.so.6 (0x00607000)
libdl.so.2 => /lib/libdl.so.2 (0x00758000)
/lib/ld-linux.so.2 (0x005ee000)

As you can see above, these are all the libraries needed by ssh. However, again, you have been slightly misled, as there is no listing for "/lib/libnss_*".

All of the dynamically libraries need to be copied. Below is a complete listing of all libraries copied. You will need to copy them from your system or from the proj1 developer environment.

  $ cd 
$ find . -iname '*\.so\.*'
./_install/usr/lib/libz.so.1
./_install/usr/lib/libkrb5.so.3
./_install/usr/lib/libgssapi_krb5.so.2
./_install/usr/lib/libk5crypto.so.3
./_install/lib/libutil.so.1
./_install/lib/libacl.so.1
./_install/lib/libcrypt.so.1
./_install/lib/libselinux.so.1
./_install/lib/libpam.so.0
./_install/lib/libcrypto.so.4
./_install/lib/libdl.so.2
./_install/lib/ld-lsb.so.1
./_install/lib/libcom_err.so.2
./_install/lib/libnss_dns.so.1
./_install/lib/libpam_misc.so.0
./_install/lib/libnsl.so.1
./_install/lib/tls/libc.so.6
./_install/lib/libm.so.6
./_install/lib/libnss_files.so.2
./_install/lib/libattr.so.1
./_install/lib/libnss_dns.so.2
./_install/lib/ld-linux.so.2
./_install/lib/libnss_files.so.1
./_install/lib/libresolv.so.2


STEP 7: Compiling and Configuring SSH

Download ssh, configure and make. Next, all files must be installed in the into the respective "_install/*" directories, without changing the keys, configs, or other files installed on your running environment. Furthermore, you'll need to have all the libraries linked correct. Basically, this means running "make install" in a "chroot" environment. But, if you "chroot", "/bin/bash" cannot be found. Plus, there are a few lib's needed with make.

Download the latest version of openssh. Note you should check the signed keys.

       $ wget http://mirror.mcs.anl.gov/openssh/portable/openssh-3.9p1.tar.gz

[**** Special Security Note ****]

In general it's good to verify keys with a trusted signature. Not covered here; but, it is something like the following. You'll need gpg. See Linux Tips in the reference.

  $ wget http://mirror.mcs.anl.gov/openssh/portable/openssh-3.9p1.tar.gz.sig
$ wget http://mirror.mcs.anl.gov/openssh/portable/DJM-GPG-KEY.asc
$ gpg --import DJM-GPG-KEY.asc
$ gpg --verify openssh-3.9p1.tar.gz.sig openssh-3.9p1.tar.gz

[**** End Special Security Note *]

If you are working in the "proj1" directory that was downloaded, you'll need to clear out any existing ssh file.

  $ cd proj1
$ find _install/usr/ -iname 'ssh*' -exec rm -f {} \;
$ find _install/etc/ -iname 'ssh*' -exec rm -f {} \;
$ find _install/bin/ -iname 'ssh*' -exec rm -f {} \;
$ find _install/sbin/ -iname 'ssh*' -exec rm -f {} \;

Reference the file "proj1/removeSSH".

Note, do this in the "proj1/_install" directory as root.

  $ su -
$ cd proj1/_install
$ cp .
$ tar -xzf openssh-3.9p1.tar.gz
$ cd openssh-3.9p1
$ ./configure --prefix=

This should leave you with the following. Note the location of the User binaries and "System binaries" when using "--prefix=" without any directory specified.

        
OpenSSH has been configured with the following options:
User binaries: /bin
System binaries: /sbin
Configuration files: /etc
Askpass program: /libexec/ssh-askpass
Manual pages: /man/manX
PID file: /var/run
Privilege separation chroot path: /var/empty
sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin
Manpage format: doc
PAM support: no
KerberosV support: no
Smartcard support: no
S/KEY support: no
TCP Wrappers support: no
MD5 password support: no
IP address in $DISPLAY hack: no
Translate v4 in v6 hack: yes
BSD Auth support: no
Random number source: OpenSSL internal ONLY

Host: i686-pc-linux-gnu
Compiler: gcc
Compiler flags: -g -O2 -Wall -Wpointer-arith -Wno-uninitialized
Preprocessor flags:
Linker flags:
Libraries: -lcrypto -lutil -lz -lnsl -lcrypt

Now run make

      
$ make

A few files need to change. This assumes your current directory is "_install/openssh-3.9p1"

  $ mv ../../_install/usr/bin/install  ../../_install/usr/bin/installBB
$ cp /usr/bin/install ../../_install/usr/bin/.

When this is done, "cd" so that your current directory is "_install".

  $ cd ..

Now, "chroot".

   $ chroot . /bin/sh -i
BusyBox v1.00 (2005.02.21-00:50+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

$ cd openssh-3.9p1/
$ make install

If all goes well, exit out of chroot.

   $ exit
$ mv usr/bin/installBB usr/bin/install
mv: overwrite `usr/bin/install'? y
$ rm -rf openssh-3.9p1*

At this point ssh should be installed with the correct references to "etc", and all other files.


STEP 8: Compiling the Linux Kernel

You do not need to download the full kernel on each revision. Note, with the "linux-2.6.11.tar.gz" there is also a patch "patch-2.6.11.bz2". The patch get's applied to the "linux-2.6.10" kernel, assuming you had already downloaded it.

Assuming you have no linux kernel's downloaded.

  $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.11.tar.gz
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.11.tar.gz.sign

Next, grab the correct key and verify the signature.

  $ gpg --keyserver wwwkeys.pgp.net --recv-keys 0x517D0F0E
$ gpg --verify linux-2.6.11.tar.gz.sign linux-2.6.11.tar.gz

At this point, you know the source code is valid. Unroll the "tar.gz".

  $ tar -xzf linux-2.6.11.tar.gz

[********** Special Note - What if you had the 2.6.10 kernel source? ***************]

If this is the case, all you need to install is the patch "patch-2.6.11.bz2". This is the preferred method, as it keeps you ".config" settings.

  $ wget http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.11.bz2
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.11.bz2.sign
$ gpg --verify patch-2.6.11.bz2.sign patch-2.6.11.bz2

$ cd linux-2.6.10 <-- note this is my existing source
$ bzip2 -dc ../patch-2.6.11.bz2 | patch -p1
$ cd ..

[********************* End Special Note ********************************************]

You may want to copy by kernel ".config", or take a look at it if downloading the ""cdrom_linux_boot_proj1.iso"" found all the drivers on your computer.

  $ wget
$ make xconfig -- This will allow you to graphically look at all
the options.

$ make bzImage -- Only do this
$ cp arch/i386/boot/bzImage ${PROJDIR}/proj1/staging_iso_image/boot/isolinux/linux26

That is it for create the compress kernel image. It may be necessary to add in additional drivers. What driver modules are used by your current system? Check "/etc/modprobe.conf"

  $ cat "/etc/modprobe.conf"
...
alias eth0 tg3
...

Notice above that "eth0", the network interface card on my current system is loading this module. If I look for "tg3" in all the kernel "Makefile's", I can see that "CONFIG_TIGON3" should compiled into the kernel.

  $ find . -iname 'Makefile' -exec grep -H 'tg3' {} \;
./drivers/net/Makefile:obj-$(CONFIG_TIGON3) += tg3.o

Check your device drives and set them to yes in the ".config" file. As you can see, the ".config" used for proj1 has this option set to yes so when the kernel boot it will automatically find the needed network drivers. These steps should be performed for any NICs, or USB devices needed at boot time.

  $ cat .config |grep 'CONFIG_TIGON3'
CONFIG_TIGON3=y

Also, if you want to NFS mount devices, you may want to include the NFS in the kernel

  CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V4=y
(see cdrom_linux_boot_unionfs.iso)
For the complete kernel config for NFS see the following link:

http://prdownloads.sourceforge.net/souptonuts/cdrom_linux_boot_unionfs.iso


UNIONFS (Optional Step)

Unionfs is a utility for merging several directories into a single unified view. For example, if you had directory "/Fruits" and "/Vegetables" then you can combine the contents of those two directories into a third, which will be "/mnt/healthy". For more usage examples, see the following article:

   http://www.linuxjournal.com/article/7714 

Unionfs will work on the 2.6.9+ kernels. The software can be downloaded from the following site:

   ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs 

Once downloaded, take a look at the Makefile. Below I have edited it to fit my environment, since my 2.6.11 kernel source is currently under "/home/chirico/kernel/BUILD/linux-2.6.11". So this is what my Unionfs Makefile looks like. All I did was change the variable LINUXSRC as shown below:

  #
# Makefile for the Linux 2.4 unionfs
#

# this should point to where your kernel headers are
#LINUXSRC = /lib/modules/`uname -r`/build
# Chirico change below - put in your location
LINUXSRC = /home/chirico/kernel/BUILD/linux-2.6.11

After this change, run "make", which will produce "unionfs.ko".

  # make

I copied "unionfs.ko" to the "_install/unionfs" directory. When you boot-up your cd, you can load this module manually.

  # insmod /unionfs/unionfs.ko

After loading successfully, you see it in "/proc/modules"

  # cat /proc/modules

Now, create the 3 directories.

  # mkdir -p /Fruits /Vegetables /mnt/healthy

And mount

  # mount -t unionfs -o dirs=/Fruits:/Begetables \ 
none /mnt/healthy
By the way, you can combine more than two directories. For example you could have done the following command.
  # mount -t unionfs -o dirs=/Fruits:/Vegetables:/etc \
none /mnt/healthy

To see the full power of Unionfs, you should create files in each of the individual directories.

The real power of Unionfs comes with NFS. See the proj_unionfs.tar.gz or cdrom_linux_boot_unionfs.iso. There is a special "/sbin/nfsmount", copied from Fedora Core 3 "/bin/mount", that will work with version 4 of NFS. Do NOT copy over the BusyBox mount command.

  $ /sbin/nfsmount -t nfs 192.168.1.182:/home /home2

See (TIP 104) on the How_to_Linux_and_Open_Source.txt tips in the reference on setting up the server to test the configuration.


STEP 9: The ISOLINUX Boot Loader

This is the boot loader. This is the first program run from the CD.

Note the following directory layout in "proj1/staging_iso_image/"

  $ cd proj1/staging_iso_image
$ tree .
.
`-- boot
`-- isolinux
|-- boot.cat
|-- isolinux.bin
|-- isolinux.cfg
|-- linux26
`-- menu.txt

There are two directories here "boot" and "isolinux", with all of the files under "isolinux". A description of each file is shown below:

boot.cat - The El Torito specification requires a "boot catalog" to be created.

isolinux.bin - This is the ISOLINUX boot loader program

isolinux.cfg - Configuration file that contains the necessary instructions for loading the kernel as shown directly below. The kernel is the file "linux26" and after the kernel loads, the compressed image file "initrd.bin" will be mounted on "/dev/ram0". After it gets mounted the program "/sbin/init", will start.

        default 1
prompt 1
timeout 300
display menu.txt

label 1
kernel linux26
append ramdisk_size=128000 initrd=initrd.bin init=/sbin/init root=/dev/ram0

label 2
kernel linux26
append ramdisk_size=128000 initrd=initrd.bin init=/sbin/init root=/dev/ram0 ramdisk_size=128000 vga=788

label 3
kernel linux26
append ramdisk_size=128000 initrd=initrd.bin init=/sbin/init root=/dev/ram0 ramdisk_size=128000 vga=791

linux26 - This is the kernel image, or the results of "make bzImage".

menu.txt - A menu specified in "isolinux.cfg" is shown directly below:

     
Choose Menu Option

1) Text Mode
2) 800x600 x 16bit color
3) 1024x768 x 16bit color

Copyright GPL (c) Mike Chirico
(mchirico@users.sourceforge.net)

For instructions on how to build your own:
http://souptonuts.sourceforge.net/cdrom.htm

Password for root is root

STEP 10: mkisofs - command to make CD image

The following command is run from the "proj1" directory. It is helpful to look at the "createiso" file for the complete process, which includes the command for building images/initrd.bin in the compressed format.

      $ mkisofs -R -b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table -o \
iso/cdrom_linux_boot_proj1.iso staging_iso_image/boot

http://sourceforge.net/project/filemodule_monitor.php?filemodule_id=145435


FAQ:

(f.1) Can you store additional data on the cdrom and read it after boot-up? How?

You must have the correct "major" and "minor" numbers for your cdrom device. For example, I have a "Second IDE hard disk/CD-ROM interface." See http://souptonuts.sourceforge.net/devices.txt for the match on that, which tells me I need "22 block 0" for the mknod command. To get this mounted, all the commands are listed here below.

    # mkdir /cdrom
# mknod -m 600 /dev/hdc b 22 0
# mount -t iso9660 -r /dev/hdc /cdrom

(f.2) What are all the steps needed for Unionfs?

You should download and burn http://prdownloads.sourceforge.net/souptonuts/cdrom_linux_boot_unionfs.iso

After you boot from the cd, issue the following command to load the unionfs kernel module.

   # insmod /unionfs/unionfs.ko

Now assuming you have an "ext3" filesystem on "/dev/hda2", mount it

   # mkdir /h
# mount -t ext3 /dev/hda2 /h

Assuming the above filesystem has "/h/etc", "/h/bin", "/h/lib" and "/h/usr" these directories can be union mounted on top of "/etc","/bin", "/lib" and "/usr" as follows:

   # mount -t unionfs -o dirs=/etc:/h/etc=ro none /etc
# mount -t unionfs -o dirs=/bin:/h/bin=ro none /bin
# mount -t unionfs -o dirs=/lib:/h/lib=ro none /lib
# mount -t unionfs -o dirs=/usr:/h/usr=ro none /usr

So what does this do? Well, now you can use gcc, emacs and a lot of the applications on the hard drive.

(f.3) How do I create the compressed initrd.bin file?

This is done in the script createiso.


ERRATA AND DOCUMENT UPDATES:

To receive email when when substantial updates occur, or corrections are found, click here.

REFERENCES:

Websites For Downloading Software

BusyBox (No need to install tinylogin, everything is included here)
http://www.busybox.net

Isolinux ( software can be found on www.kernel.org )
http://www.kernel.org/pub/linux/utils/boot/syslinux

Linux Kernel
http://www.kernel.org

OpenSSH
http://www.openssh.com

SoupToNuts
http://sourceforge.net/project/showfiles.php?group_id=79320&package_id=145435

Linux from Scratch
http://www.linuxfromscratch.org

Recommended Reading

Virtual Filesystem: Building A Linux Filesystem From An Ordinary File
http://freshmeat.net/articles/view/1387
or
http://prdownloads.sourceforge.net/souptonuts/README_Virtual_FS.html

"Building Embedded Linux Systems", by Karim Yaghmour O'Reilly, 2003
ISBN 0-596-00222-X, pages 416.

BusyBox FAQ
http://www.busybox.net/FAQ.html

100+ Linux Tips
http://souptonuts.sourceforge.net/how_to_linux_and_open_source.htm

Kernel Korner - Unionfs: Bringing Filesystems Together
http://www.linuxjournal.com/article/7714

Related Websites

      http://www.gnu.org/software/grub/manual/html_node/Making-a-GRUB-bootable-CD-ROM.html
http://aurach.ewu.edu/ield/ield_course/lectures/ield_ch3.html
http://lfs.osuosl.org/lfs/view/stable/chapter01/chapter01.html#ch-scatter-how
http://www.linuxfromscratch.org/
http://www.dobit.com/emblin/embhowto.htm
http://tldp.org/LDP/intro-linux/html/sect_04_02.html
http://www.linux4.be/~jroark/howto/ramdisk.html
http://linuxdevices.com/articles/AT9416075241.html
http://www.linux.org/docs/ldp/howto/Bootdisk-HOWTO/troubleshooting.html
http://gnubox.dyndns.org:8080/~sunil/knoppix.php
http://www.linuxjournal.com/article/7383
http://www.uclibc.org/
http://www-106.ibm.com/developerworks/web/library/wa-cranky37.html



Other Tutorials

Gmail on Home Linux Box using Postfix and Fetchmail: If you have a Gmail account and would like to use it in conjunction with your personal computers, this tutorial will walk you through configuring and installing the latest version of Postfix with SASL authentication and TLS encryption necessary for connecting and relaying mail to smtp.gmail.com and configuring fetchmail with STARTTLS to fetch messages from your Gmail account to your local system. It will also discuss how to forward mail to other computers and how to automatically backup copies of email messages.

Breaking Firewalls with OpenSSH and PuTTY: If the system administrator deliberately filters out all traffic except port 22 (ssh), to a single server, it is very likely that you can still gain access other computers behind the firewall. This article shows how remote Linux and Windows users can gain access to firewalled samba, mail, and http servers. In essence, it shows how openSSH and Putty can be used as a VPN solution for your home or workplace.

SQLite Tutorial : This article explores the power and simplicity of sqlite3, first by starting with common commands and triggers, then the attach statement with the union operation is introduced in a way that allows multiple tables, in separate databases, to be combined as one virtual table, without the overhead of copying or moving data. Next, the simple sign function and the amazingly powerful trick of using this function in SQL select statements to solve complex queries with a single pass through the data is demonstrated, after making a brief mathematical case for how the sign function defines the absolute value and IF conditions.

The Lemon Parser Tutorial: This article explains how to build grammars and programs using the lemon parser, which is faster than yacc. And, unlike yacc, it is thread safe.

How to Compile the 2.6 kernel for Red Hat 9 and 8.0 and get Fedora Updates: This is a step by step tutorial on how to compile the 2.6 kernel from source.

Linux System Admin Tips: There are over 160 linux tips and tricks in this article. This article is updated weekly.

Virtual Filesystem: Building A Linux Filesystem From An Ordinary File. You can take a disk file, format it as ext2, ext3, or reiser filesystem and then mount it, just like a physical drive. Yes, it then possible to read and write files to this newly mounted device. You can also copy the complete filesystem, sinc\ e it is just a file, to another computer. If security is an issue, read on. This article will show you how to encrypt the filesystem, and mount it with ACL (Access Control Lists), which give you rights beyond the traditional read (r) write (w) and execute (x) for the 3 user groups file, owner and other.

Working With Time: What? There are 61 seconds in a minute? We can go back in time? We still tell time by the sun?

Wednesday, July 30, 2008

privacy policy

linux-ad.blogspot.com Privacy Statement

What follows is the Privacy Statement for all linux-ad.blogspot.com websites (a.k.a. blogs) including all the websites run under the linux-ad.blogspot.com domain.

Please read this statement regarding our blogs. If you have questions please ask us via our contact form.

Email Addresses

You may choose to add your email address to our contact list via the forms on our websites. We agree that we will never share you email with any third party and that we will remove your email at your request. We don’t currently send advertising via email, but in the future our email may contain advertisements and we may send dedicated email messages from our advertisers without revealing your email addresses to them. If you have any problem removing your email address please contact us via our contact form.

Ownership of Information

linux-ad.blogspot.com is the sole owner of any information collected on our websites.

Comments/Message Boards

linux-ad.blogspot.com websites contain comment sections (a.k.a. message boards). We do not actively monitor these comments and the information on them is for entertainment purposes only. If we are alerted to something we deem inappropriate in any way, we may delete it at our discretion. We use email validation on most of our message boards in order to reduce “comment spam.” These email addresses will not be shared with any third party.

Cookies

Currently we assign cookies to our readers in order to save their preferences. This data is not shared with any third party. Accessing our websites is not dependent on accepting cookies and all major browsers allow you to disable cookies if you wish.

Third Party Cookies

Many of our advertisers use cookies in order to determine the number of times you have seen an advertisement. This is done to limit the number times you are shown the same advertisement. linux-ad.blogspot.com does not have access to this data.

Traffic Reports

Our industry-standard traffic reporting records IP addresses, Internet service provider information, referrer strings, browser types and the date and time pages are loaded. We use this information in the aggregate only to provide traffic statistics to advertisers and to figure out which features and editorials are most popular.

Legal proceedings

We will make every effort to preserve user privacy but linux-ad.blogspot.com may need to disclose information when required by law.

Business Transitions

If linux-ad.blogspot.com is acquired by or merges with another firm, the assets of our websites, including personal information, will likely be transferred to the new firm.

Links

linux-ad.blogspot.com websites frequently link to other websites. We are not responsible for the content or business practices of these websites. When you leave our websites we encourage you to read the destination site’s privacy policy. This privacy statement applies solely to information collected by linux-ad.blogspot.com

Notification of Changes

When linux-ad.blogspot.com makes changes to this privacy policy we will post those changes here.

Contact Information

If you have any questions regarding our privacy policy, please contact us. halimyanuar@yahoo.com