Linux Tutorial

Linux Installation/Configuration tutorial based on

RedHat 6.1 and assuming to be the domain name.

Compiled by H. K. Kumar and based HOWTO Documentation

Note: This tutorial is based on RedHat 6.1. Some of the configuration may not work on Higher version of RedHat Linux e.g. Samba Configuration. In order to get tutorials on RedHat 7.x contact HK Net Solutions front office or mail to

  1. Backup drives.

  2. Create boot disk.

  3. Install any new hard drives (recommended).

  4. Install Linux operating system.

  5. X Customize Windows system.

  6. User account management.

  7. Setup print services.

  8. Setup Samba file services and file sharing.(SMB)

  9. Setup Point-to -Point Protocol (PPP) for INTERNET access.

  10. Software installation and management using RedHat Package Manager (RPM).

  11. Local e-mail setup using IMAP and POP3 protocol.

  12. Kernel compilation.*

  13. Setup Dynamic Host Configuration Protocol (DHCP)*

  14. Setup Domain Name Services (DNS) server.*

  15. Setup Apache web sever and web server management*

  16. Setup of NIS server.*

  17. Setup off-line e-mail services*

  18. Setup IP Masquerading and IPCHAINS firewall rules*

  19. Setup of Diskless Computer.*

  20. Mirroring of Disk.*

  21. RAID*

  22. Relational Database Management System,(RDBMS) Installation and management.*

  23. Dynamic Web Server development.*

Before starting the Linux installation procedure, you should know the details about your hardware. Using Windows 95/98/NT, find the manufacturer, model, IRO and I/O address of your Video card, Ethernet Card, Modem, Mouse, etc and the Monitor type.

Start of Installation Procedur.

For detail installation procedure contact HK Net Solution front office or mail

Your machine should be running Windows 95/98/NT

  1. Insert the RedHat 6.1 CD into the CD drive.

  2. Insert a formatted 3.5" diskette into the floppy drive

  3. Open a DOS command window:

    Start -> Programs -> MSDOS Prompt

  4. Assuming the CD-ROM drive letter in your computer is F:, type the following command

    F:\dosutils\rawrite -f F:\images\boot.img -d a:

    Here boot.img is the RedHat boot diskette image file, which is in the directory/images of the RedHat CD.

  5. Restart the machine

  6. At the RedHat 6.1 boot: prompt, hit return. This will start the Linux operating system from the CD with an X-windows user interface.

  7. Follow the installation prompts.

    Accepts the default values for the Keyboard Configuration window. Click Next. Select the proper mouse type for your machine. Click Next.

    In the Install Type window, select Custom install. Click Next. In the Disk Druid window, create the following partitions for the Linux operating system. If you have Win 95/98 installed, make sure you don't delete that partition accidentally. Use the Add button to create a new partition. Following table is fit for computer having 10GB HDD for linux, 10-users and 128MB RAM.

    Mount point

    Partition Type



    Linux Native

    1000 MB


    Linux Native

    100 MB


    Linux Native

    2000 MB (depends on the number of user
    - Min. 200 MB per user)


    Linux Native

    2500 MB


    Linux Native

    1000 MB


    Linux Native

    1500 MB


    Linux Native

    1000 MB


    Linux Native

    500 MB


    Linux Swap

    256 MB (Assuming installation of Linux
    on computer having 128 MB RAM)

  8. In the Choose partition to Format window, select all the partition to be

    formatted Do Not check the Check bad blocks button.

  9. In the Lilo Configuration window, select create boot disk if you want to

    create a boot disk. Select Do Not Install Lilo button if don't want to install Lilo. Lilo is the boot loader for Linux. If do not install Lilo, Then you must create a Boot Diskette, otherwise you will not be able to boot your Linux machine!

  10. In the Network Configuration window, select Activate on boot. Type your IP address and other network parameters:

    IP address: 192.168.1.n (where n is from 1 to 254)




    Host name:

    Default gateway: (it should be supplied by your ISP)

    Primary name sever (it should be supplied by your ISP)

    Leave the Secondary name sever and Tertiary name server blank. Click Next

  11. In the Time Zone window, select your area/country as the time Zone.

  12. Type some-password as the root password (you have to type it twice). Just hit OK in Authentication Configuration window. Also create an user account at this time.

    User name: some-user-name

    Password: password-for-the-user

    Click Add. Click Next.

    Click Next in the Authenticationcon window.

  13. At the Package Group Selection window, select the following packages in Addition to the already selected packages:


    DOS/Windows connectivity

    Graphics manipulation

    SMB (samba) server

    IPX/Netware connectivity

    Anonymous FTP server

    Web server

    DNS Name server

    Network management workstation


    Kernel Development


    Once all the packages are selected, click Next (Do not select individual packages).

  14. The X-Configuration window should now automatically detect the video card. If not, select the proper video card. It should also detect the monitor. If not select Generic Multisysnc as your monitor. Click on the Test this Configuration button. IF everything is OK, it will start the X window system, and ask you to click YES button. If it could not start the X window system, it will come back in about 10 to 15 seconds.

  15. Click on the Use Graphical login button. Click Next to start the actual installation process. (Non-Graphical Login Recommended)

  16. AT the Bootdisk Creation window, insert a formatted blank diskette and click next. When done, click Exit and the machine will boot the Linux operating system. Login as some-user-name, with password password-for-the-user.. This will start the GNOME window manager by default.

Customizing X windows:

The default setup of Linux generally creates 7 virtual; consoles. You can cycle through these consoles using the CTRL-Ait-F1 to F7. The X windows system normally runs in the console 7. The default setup we accepted during Now we are going to create three different color depths and a number of display resolutions. Hit Cntrl-Alt-F1 to go to console 1. Login as root. Type Xconfigurator. Click OK. It will automatically detect the video card and install the appropriate driver for it. In the Monitor Setup window, select your monitor type. If your monitor type is not in the list, and select Generic Multisync. In the resolution selection windows, select Let Me Chose and select as many resolutions as you want in each color depth. Click OK. It will start the X server. If you can see the new X window, click in the OK button. When back to the command window, hit CTRL-ALT-F7 to go back the previously running X server window. IF you are logged in, logout and login again at the login prompt. You can cycle through the different resolutions using Cntrl-Alt and the +Key of the numeric keypad. For RedHat 6.1, GNOME is the default window manager. During login, you can select other window managers, such as KDE, Afterstep etc.

User Account Management:

Click on the Foot button (main menu) at the lower left corner and select System ->Linubconf menu. Click Quit (you have to do this only the first time you start linux conf). Scroll down the list and select User Accounts ->Normal->User Accounts item in the list, click on the Add button, and fill-out the form to create the account.

  • Type some-other-user in the Login Name box.

  • Type Users Full name in the Full Name box.

  • Click Accept button to create the account.

  • When prompted for password, type password for this user.

  • Select Quit. Select Quit again to quit the Linuxconf.

  • When prompted, select Activate Changes.

Printer Setup:

From the GNOME main menu, select System->Control panel. In the control panel, click on the printer icon. Click on Add, Local printer, and once the printer is detected, click on the Select button and select the appropriate printers (for our lab it is HP Deskjet series). For all other windows, accept and default. Select the Send EOF after job and Fix stair-stepping text buttons. Click OK. Click OK. Select the just created printer entry, and use Tests menu item to print Postscript test page.

Samba (SMB) File Server Setup:

Edit the file/etc/inetd.conf (you can use System->Application->gedit) and uncomment the line containing swat specification (that is, delete the leading # sign). Restart inetd by typing /etc/ rc.d/ init.d/inet restart in a command window. Start Netscape and open the URL http://localhost:901/ when asked for User ID and Password, type root and root-password respectively. This will bring up the Samba configuration page.

Click in Globals

Change work group to LINUX_GROUP

Change netbuos name to your machine name.

Click on Commit changes (upper left corner)

Click on STATUS

Click on Restart smbd and Restart nmbd

To check that samba is actually running, in a command window, type symbclient -L machine-name -U root.

When prompted for password, type root-password. IF everything is OK, it will show a list of shared volumes and servers. For detail how to share a volume, please contact HK Net Solutions ormail at .

RPM Packages installation and DHCP Setup:

In this step, we will learn how to setup the Linux box a DHCP server, as well as how to install additional packages (software packages) by installing the DHCP package. In the Linuxconf window, select File System -> Access local drive. Select the /dev/cdrom entry and click on Mount button. Click on Yes. This will mount the RedHat 6.1 CDROM as a file system. From the Main menu, select System ->GnoRPM. Click on the Install button. Click on the ADD button in the popup window. From the popup list, select dhcp-2.0b1 p16-6.i386.rpm and click Add, then select dhcpd-1.3.17 p12-1.i386.rpm and click Add. Close the list window. Click the Install button in the install window. Close GnoRPM. Create or modify the file/etc/dhcpd.conf and put the proper configuration data in it (As shown below ).


subnet netmask {

# --- default gateway

option routers;

option subnet-mask;

option nis-domain "";

option domain-name "";

option domain-name-servers;

option time-offset -5; # Eastern Standard Time

# option ntp-servers;

# option netbios-name-servers;

# --- Selects point-to-point node (default is hybrid). Don't change this unless

# -- you understand Netbios very well

# option netbios-node-type 2;

range dynamic-bootp;

default-lease-time 21600;

max-lease-time 43200;



Edit /etc/rc.d/init.d/dhcpd and add the following line in the Start section before dhcpd is called:

route add -host dev eth0

Touch (create) the file /etc/dhcpd. Leases

Touch /var/state/dhcp/dhcpd. Leases

Check the funtionality of dhcp by starting dhcp manually using.

/usr /sbin /dhcpd -d-f

Once the DHCPD is started, turn on a Window machine, which is connected to the same physical network and check whether it can receive the configuration data from it (assuming the Windows client is setup for DHCP in the Network Control Panel, that is, Obtain IP address automatically is checked). You use winipcfg command in the Windows machine to check its's IP parameters.

By the way, If you don't know how to use vi editor, then use the gedit in the Application menu of the GNOME window manager to edit the dhcpd. Conf file.

Modem Setup:

Open System->Control Panel from the main menu. Click on the moderm icon. Select the appropriate COM port your modem is connected to (Com1, Com2, etc.). Click OK. If you have an internal modem, then find out the modems IRQ, IO address and COM port under Windows. This can be done using the Windows Control Panel, Systems. For external modems, just find out the serial port it is connected to.

Under linux, as root type the following command for internal modem:

Setserial / dev/ ttyS2 irq 9, port 0x3e8 spd_vhi

Where com2=/dev/tty S2, com3=/dev/tty S3.etc. And substitute the real IRO, port address of your modem. For the externala modem, you can use the modem tool in the control panel.

Use minicom -s to check your modem by dialing out.

Dialup Networking (PPP) Setup:

From the control - panel click on the Network Configuration button ( or from a command line window , type netcfg). This will bring up the Network control panel. Click on the Interface button, click Add, Interface type PPP, type the phone number of your ISP, login name, ppp password. Click on Customize button, select hardware flow control, select /dev/modem, click on Communications button, edit the chat script according to your ISP instruction (such as, remove the last two lines and Append: expect %, send run _ppp).

Local E-Mail Setup:

Install Package imap-4.5-3.i386.rpm. Edit the file/etc/inetd.conf and uncomment (delete the # character at the beginning of the line) the lines containing pop-2, pop-3 and imap. Save the file. Restart the inetd daemon by typing the following at the command prompt:

/etc/rc.d/ init.d/ inet restart

Check that it is working by typing the following at the command prompt:

teinet local host 110

And if you get a response saying something with POP3, then it is working. GET out of this by typing Quit in a line by itself. Now your e-mail is working.

DNS Setup

  1. To setup a Domain Name Service (DNS) server (caching only), install the caching name server package, if it is not already installed during RedHat installation.

  1. Check the /etc/resolve. Conf file and make sure it contains the following lines:

Search your subdomain name your domain your ispdomain. Isptopdomain

Name server 127. 0. 0.1.

  1. Check the /etc/host.conf file and make sure it has atleast the following line: Order hosts, bind

  2. Edit the /etc/hosts file put the IP adresses and fully qualified host names of all the frequently accessed hosts.

  1. Start the named daemon: /etc/rc.d/init.d/named restart

  1. Check that the name server is working by using the nslookup command. Just typing ns lookup in the command line should return:

Default Server: local host


(You can type exit to exit ns look up)

PPP Setup for RedHat 6.1

  1. Make sure your kernel have PPP support. The default kernel that RedHat 6.0 installs has PPP support built into it.

  1. Login as root and start Xwindows by typing Starts at the prompt #.

  1. Click on Networking icon on the control-panel. Click on the Interface button, click Add, Interface type PPP, type the phone number of your ISP, login name, ppp password, Click on Customize button, select hardware flow control, select Abort connection on Well known Errors, select line speed: 115200, modem port: /dev/tty/S1, click on Communications button, edit the chat script according to your ISP instructions (such as, remove the last two lines and Append: expect %, send ppp_ run).

  1. Check proper operation of PPP by bringing up the ppp link (click on Activate button) and using Netscape (You installed Netscape during RedHat at Linux installation, didn't you?).

File sharing using Linux

  1. You share all types of resources using the Linux server, such as file sharing, Printer sharing etc. with DOS, Windows, and Unix clients and all these can be done simultnesouly!

  2. To export a Windows 95 file system, make sure your kernel has viat support compiled into it. Otherwise, compile a new kernel.

  3. Mount the Windows 95 Partition under Linux a vfat type file system.

Mount -t vfat /dev/hdal /Cdrive (make sure to change the

partition name and mount point to mach your system. Before

giving the above command make sure that you have created

the directory Cdrive in / )

  1. Install samba (it can be installed during normal installation of RedHat Linux) or install it using the rpm. For more detail, see the Samba doc. For the latest Samba, download it from :

http://us1.Samba.Org/samba/ftp/bin-pkgs/redhat/RPMS/5.2/samba-2.0.3-19990228.i386.rpm or newer. It has a web based configuration tool called swat, which is very easy to use.

      1. Edit/etc/smb. Conf and configure proper workgroup naem, and put a section for the dosc partition similar to the default (home) section.

      2. For Win 98 and NT 4 clients, must setup encrypted password in samba. If you have only a few Win 98/NT 4 machines, then the Win98 clients can be setup to send clear text passwords. Insert the Win98 CD in the drive, right click the file\tools\MTSutif\ptxt_on. Inf and select install. Reboot the Win 98 client machine. This will allow clear text password to be sent by the Win98 client, which could be a security risk. To setup encrypted password in samba, use mk and smbpasswd to create and mangae the samba passwords.

Cat /etc/passwd /usr/bin/>/etc/smbpasswd

/usr/bin/smbpasswd username

This will create a encrypted smbpasswd file from the Unix /etc/passwd file with passwords deactivated.

The second command will allow to change the password for each individual user. For more information, see in/usr/doc/samba * * /docs / ENCRYPTION. Txt

  1. Restart smb daemon: kill - HUP (smbd Pid)

  2. You can use nw-mars to share Netware volumes; NFS to share Unix volumes; Netatalk to share Appletalk volumes.

Samba (SMB File System) Setup for Linux

  1. Make sure you have installed the Samba package during RedHat installation. Check using the command rpm -ql samba.

  2. If Samba is not installed, install samba: rpm- Uvh samba - 2.0.3-8.i386.rpm

  3. You can use the wen based samba administration tool swat to set up samba. First edit the file /etc/inetd.conf and uncomment line containing swat specification. The restart inetd by typing /etc/rc.d/init, d/inet restart. Point your browser to http://localhost: 901/. After changing and setting up the samba service through swat, restart samba by /etc/rc.d/ init.d/smb restart.

  4. You can manually setup samba by editing the file /etc/smb. /conf and changing the following entries:

In the {global} region, change workgroup = WORKGROUP to whatever workgroup the clients will be using, such as LINUX_GROUP

Change the comment = to an appropriate string

Change the volume = to an appropriate volume identifier

  1. If you want to export any other volumes other than the default home directories, add another section after the {homes} section similar to the home section. For example, to export the directory /dosc, add the following lines after the {homes} section:


comment = DOS directory C:

path = /Cdrive

browseable = yes

read only = yes

preserve case = yes

Short preserve case = yes

create mode = 0750

  1. For Win 98 and NT 4 clients, must setup encrypted password in samba. If you have only a few Win 98/NT4 machines, then the Win98 clients can be setup to send clear text passwords. Insert the Win 98 CD in the drive, right clicks the file\tools\MTSutil\ptxt_on. Inf and select install. Reboot the Win98 client machine. This will allow clear text password to be sent by the Win98 client, which could be a security risk. To setup encrypted password in samba, use and smbpasswd to create and manage the samba passwords.

Cat /etc/passwd /usr/bin/>/etc/smbpasswd

/usr/bin/smbpasswd username

This will create a encrypted smbpasswd file from the Unix/etc/passwd file with passwords deactivated. The second command will allow to change the passwprd for each individual user. For more information, see in /usr/doc/samba * * /docs / ENCRYPRTION. Txt

  1. Restart SMB: /etc/rc.d/init.d /smb restart

  2. From the server check that samba is working. Type:

Smbclient - L servername - U username

And when promoted for password type your valid user password on the server. It should show the expoted list. Or type smbstatus to see the simple status of samba.

  1. From a client machine check whether the exported volumes are available or not. IF not use the Windows Explorer Map Network Drive button to connect to the samba volume. In the path box type:

\\ Servername\username

Where server is the name is the name of the server, eg., csehome, username is a valid user account in the server.

  1. You can download a newer version of Samba from It has a web based configuration tool called swat, which is very easy to use.

  2. You can also use linuxconf and samba server tab to setup samba.

On-Line Linux Resources and Documentation

For detail information on different services available under Linux please see the following documentation:

Please read all the documentation in the Linux Documentation Project (LDP) at :

For hardware information, please see:

http: //metalab. unc. edu/pub/Linux/docs/HowTO/Hardware-HOWTO

For Installation information, please see:

http: //

For DNS information, please see:

For PPP information, please see:

For DHCP information, please see:

For samba information, please see:

For IP masquerding information, please see: and

For Remote offline E-mail information, please see:

One of the best resource for rpm package is:

*For latest version of tutorials please contact HK Net Solutions.