Experiment No 1

Aim: To study basic & user status Unix/Linux Commands.
Hardware Requirement: Desktop requirements are higher, but 600MHz with 256 or
512MB of RAM gives comfort. It means that any recent computer will do. If tweaked,
however, it would run, on 200MHz with 64MB of RAM, however. Typical installation
takes about 3GB (will all desktop applications, like Open Office).
Procedure:
Unix

Description

Command
ls

List directory contents

cp

Copy files

rm

Remove directory entries

file

Determine file type

find

Walk a file hierarchy

which

Locate a program file in the user’s
path

whereis

Locate programs

gcc, g++

GNU project C and C++ Compiler

gdb

The GNU Debugger

less

View the contents of a text file

diff

Find differences between two files

cmp

Compare two files

vi

Text editor

chmod

Change file modes

man

Display the on-line manual pages

mv

Move and rename files

ispell

Interactive spelling checker

biff

Be notified if mail arrives and who it is
from

lpr

Print a file

lpq

Show the print queue

ftp

Transfer a file to another Unix system

logout

Quit using the system

pwd

Print working directory name

cd

Change working directory

ln

Make a file link

mkdir

Make directories

rmdir

Remove directories

chmod

Change file modes

quota

Display disk usage and limits

history

Display a list of recent commands

ps

Show the status of processes

kill

Stop a running processes

passwd

Change your password

alias

Create a command alias

unalias

Delete a command alias

export

Set an environment variable

script

Record your terminal session to a file

bg

Send a job to the background

fg

Bring a job to the foreground

jobs

Print a list of current jobs

User Status Command
Finger command is used to lookup information about an user.

2 finger Examples
1. View detail about a particular user
finger command will display login, username, home directory, shell information about a
particular user as shown below.
$ Finger sathiya
Login: sathiya

Name: (null)

Directory: /home/sathiya

Shell: /bin/bash

On since Mon Nov 1 18:45 (IST) on :0 (messages off)
On since Mon Nov 1 18:46 (IST) on pts/0 from :0.0
New mail received Fri May 7 10:33 2010 (IST)
Unread since Sat Jun 7 12:59 2008 (IST)
No Plan.
2. View login details and Idle status about an user
Can use finger -s option to view the login detail for a particular user.
$ finger -s root
Login

Name

Tty

root

root

*1

19d Wed 17:45

root

root

*2

3d Fri 16:53

root

root

*3

Mon 20:20

root

root

*ta

2 Tue 15:43

root

root

*tb

2 Tue 15:44

Idle Login Time Office

Office Phone

Syntax and Options
Short
Option

Option Description
Display the user’s login name, real name, terminal name and write status

-s

idle time, login time, and either
office location and office phone number, or the remote host.

terminal name and write status idle time. User is usually a login name. login time. . the office location and office -o phone information is displayed instead of the name of the remote host.plan. -m real name.Display the user’s login name. or the remote host. words & characters are present in that file.forward.Prevent the -l option of finger from displaying the contents of -p the . however. Prevent matching of user names.txt with some lines & display how many lines. When used in conjunction with the -s option.project and . . Result: Basic & user status commands are known. and either office location and office phone number. unless the -m option is supplied.pubkey files. matching will also be done on the users’ real names. . Experiment No 2 Aim: Create a file called wlcc.

Hardware Requirement: Desktop requirements are higher. Procedure: Algorithm: 1. it would run. Input the name of the file. but 600MHz with 256 or 512MB of RAM gives comfort.” $wlcc.txt is $w echo Number of lines in $wlcc.txt’ echo Number of characters in $wlcc.txt is $c echo Number of words in $wlcc. on 200MHz with 64MB of RAM. Count the words of the given file. however. Count the characters of the given file. 5.txt w= ‘cat $wlcc. . Hardware Requirement: Desktop requirements are higher. words & characters of given file is known now. Print the result. It means that any recent computer will do. Coding: echo Enter the filename read wlcc. like OpenOffice). Count the lines of the given file. however. 4. but 600MHz with 256 or 512MB of RAM gives comfort.txt | wc –c’ l= ‘grep –c “. It means that any recent computer will do.txt | wc –w’ c= ‘cat $wlcc. Typical installation takes about 3GB (will all desktop applications. 2. 3. If tweaked. Experiment No 3 Aim: Create a program to find out the inode number of any desired file. If tweaked.txt is $l Result: Lines.

If tweaked. however. Display the result. on 200MHz with 64MB of RAM. Coding: read fname #file name to be searched. but 600MHz with 256 or 512MB of RAM gives comfort. It means that any recent computer will do. like OpenOffice). Experiment No 4 Aim: Study & use of the command for changing file permissions. Typical installation takes about 3GB (will all desktop applications. Count the inode number of the file. however. . 3. p=`pwd` cd / l=`find -name $fname` l=`echo $l | ls -i` set $l echo "inode is $1" cd $p Result: Inode number of a given file is known now. 2. Hardware Requirement: Desktop requirements are higher. like OpenOffice). it would run. however. Input the name of the file. Typical installation takes about 3GB (will all desktop applications. it would run. on 200MHz with 64MB of RAM.however. Procedure: Algorithm: 1.

Procedure: Every file or folder in UNIX has access permissions. others. 2. Textual representation like "-rwxr--r--" It is used in UNIX long directory listings. It is either "d" if the item is a directory. File permissions notation 2. Symbols in positions 7 to 9 ("r--") are permissions for others. It consists of 10 characters. There are three types of permissions (what allowed to do with a file): read access write access execute access Permissions are defined for three types of users: the owner of the file the group that the owner belongs to other users Thus. Next 9 characters are permissions. consisting of three groups: owner. . UNIX file permissions are nine bits of information (3 types x 3 type of users). The first character shows the file type. Each group consists of three symbols: rwx (in this order). or "-" if the item is a regular file.1. group. or "l" if it is a link. Symbols in positions 4 to 6 ("r--") are permissions for the group. Simply put. For programs or scripts it also can be set if they are allowed to be executed. Example: -rwxr--r-0123456789 Symbol in the position 0 ("-")is the type of the file. if some permission is denied. Symbols in positions 1 to 3 ("rwx") are permissions for the owner of the file. for each file it can be specified who can read or write from/to the file. each of them may have just one of two values: allowed or denied. then a dash "-" is used instead.

Numeric (octal) representation like "644" If a numeric representation is used (like in chmod command. Respective access rights for owner. write. and digits involved are 0 to 7. dr-x------ owner has read and execute access. "w" or "x" if according access type is denied 2. the fourth digit ("4" in the example) stands for rights of others.1. Examples File. group and others (in this order) are the last three digits of the numeric file permissions representation. for example). group and others have no access 2.r Read access is allowed w Write access is allowed x Execute access is allowed - Replaces "r".2. write and execute permissions together. Directory. This table shows what numeric values mean: Octal digit Text equivalent Binary value Meaning 0 --- 000 All types of access are denied 1 --x 001 Execute access is allowed only 2 -w- 010 Write access is allowed only . execute permissions. the third digit ("4" in the example) stands for rights of the group. then it is in the octal format (with the base of 8). -rwxr-xr-x owner has read. Octal format is used for the simplicity of understanding: every octal digit combines read. group: only read and execute permissions. Example: "0644". Here the second digit ("6" in the example) stands for rights of the owner. others: only read and execute permissions.1.

in C language. 2. sticky bit. leading zero means that the value is in the octal format. you add 4 (read) and 2 (write). others: read and execute permissions.3. SGID. it can be omitted. Basically. Why there is a leading zero? In programming. owner: read. "2" stands for write only. group and others rights are the last three digits of the permissions. for instance. To get read and execute permissions.2. For instance. Four meaningful digits like "4755" There are cases when you may come across four non-zero digits.2. write and execute permissions. Examples owner: read and write permissions.2. 755 group: read and execute permissions.3 -wx 011 Write and execute access are allowed 4 r-- 100 Read access is allowed only 5 r-x 101 Read and execute access are allowed 6 rw- 110 Read and write access are allowed 7 rwx 111 Everything is allowed We see that "1" stands for execute only. 644 group: only read permissions. thus getting 5 (read and execute). To combine the permissions you can simply add 1. "4" stands for read only. 2. group and others. thus getting 6 (read and write). . 2 and 4 to get a needed combination. you add 4 (read) and 1 (execute). Owner. others: only read permissions.2. high to low): SUID. in this case the first meaningful (non-zero) digit combines the following bits (in this order.1. We also know that the last three are for owner. to get read and write permissions. 2. See this table for more information about SUID and so on.

It is because "nobody" needs to read the file. etc you usually need to set 644 permissions. as the file is interpreted by an interpreter such as Perl and therefore must be readable. Difference in access permissions for files and folders Access permissions for files and folders mean different things from the user standpoint. For scripts you need 755 rights. "Nobody" doesn't belong to your group and thus it inherits permissions that "others" have to your files. go to it (make it to be the current working directory) 4.3. Access File type If the file contents can be Read read Write Folder If the directory listing can be obtained If user or process can If user or process can change directory contents write to the file (change somehow: create new or delete existing files in its contents) the directory or rename files. For generic files such as html or images. that Execute If the file can be executed is. For yourself you need a right to read and write (hence 6) to the file. If user or process can access the directory. to the connected web client. The table below shows the difference. The script should be executable by "nobody". and thus the file should be readable by others. Thus it must . hence 4 (read only) permissions for both group and others. typically user "nobody". The script file should also be readable by "nobody". Permissions required for web server Web server assigns the rights of the web-server-specific user. as if "nobody" is connected to the web server.

Same as above. Permissions set for FTP-uploaded files When upload files to your web hosting accounts. It was used to trigger process to "stick" in memory after it is finished. SGID or setgid: change group ID on execution. For yourself you need to have also write access. 6. If setuid bit is set. Set user ID. Numeric representation Octal digit Binary value Meaning 0 000 setuid. the process will have the same rights as the owner of the file being executed. For directories it also may mean that when a new file is created in the directory it will inherit the group of the directory (and not of the user who created the file). setgid. as "nobody" belongs to "others" group. sticky bit In addition to the basic permissions discussed above. getting 755 as a result. and depending on provider's FTP server configuration they may get different permissions in different situations. Usually.1.combine read and execute permissions for "others". Sticky bit. Also can change the file permissions with FTP client or by executing a chmod command in telnet. 6. 5. but inherits rights of the group of the owner of the file. by default files get 644 permissions. sticky bits are cleared 1 001 sticky bit is set . set group ID. Currently its use is system dependant and it is mostly used to suppress deletion of the files that belong to other users in the folder where we have "write" access to. you become the owner of the files. there are also three bits of information defined for files in UNIX: SUID or setuid: change user ID on execution. now this usage is obsolete. when the file will be executed by a user.

Syntax and examples of the shell chmod command (telnet or SSH) . Textual representation If set. Examples: Sticky -rwxrwxrwt both others execute and sticky bit are set -rwxrwxr-T sticky bit is set. then replaces "x" in the others permissions to "t".both owner execute and SUID are set -r-S-----. Examples: SUID -rws-----. then in the command prompt you need to execute a chmod command.both group execute and SGID are set -rwxr-S--. Also can set the permissions with the help of other programs. setgid. then replaces "x" in the owner permissions to "s". if owner has execute permissions.2 010 setgid bit is set 3 011 setgid and sticky bits are set 4 100 setuid bit is set 5 101 setuid and sticky bits are set 6 110 setuid and setgid bits are set 7 111 setuid. or to "S" otherwise. or to "S" otherwise. 2.SUID is set. Examples: SGID -rwxrws--. but others execute is not set 1. if others have execute permissions. but owner execute is not set If set. but group execute is not set If set. First you need to telnet or SSH to the target computer. sticky bits are set 6. then replaces "x" in the group permissions to "s".2. or to "T" otherwise. if group has execute permissions. What is a chmod command? Chmod command sets UNIX file permissions.SGID is set. such as FTP client.

g. e. group and others). show information only if changes are made to the file Permissions could be one of the following: Octal numeric format. you can use several comma separated text form permissions File[s] can be either relative path to the file like "file.g. without a leading zero like "644" Text form like "a+r".Syntax of the chmod command is the following: prompt> chmod [options] permissions file[s] The word "chmod" should be entered all in lowercase letters.pl /var/spool/mail/paul" file name mask like "*. "forced" or silent mode -v. Options can be: -R. set permissions recursively -f. "u=rwx" or "o-w".g.: "o=r" allows others only to read the file Sets permissions for all (owner.html" or "*" What text permissions values mean: u g o a Sets permissions for the owner of the file. e. e. show information for every file processed -c.g. "verbose". with a leading zero like "0644" Octal numeric format. e.: "u+w" allows the owner to write to the file Sets permissions for the group (to which owner belongs). "g-x" suppresses the execution of the file by the group Sets permissions for other users (that are not in group).: "a-w" disables write access to the file for everyone .pl" absolute path to the file like "/var/spool/mail/paul" several space separated files like "file.

r Sets read permissions w Sets write permissions x Sets execute permissions t Sets sticky bit.sh prompt> chmod u=rwx. except that the first four set SUID & SGID and sticky bits to zero and the last two don't touch SUID & SGID and sticky bits: prompt> chmod 0755 script. All commands do the same thing.go-w script.sh prompt> chmod u+rwx. this example doesn't touch read and write permissions. e.g. "a-x" disables execution of the file for everyone. .sh This example performs recursive chmod for the directory: prompt> chmod -R 755 mydirectory. "g+s" sets SGID.sh prompt> chmod u=rwx.sh prompt> chmod u+rwx. keeping all other (not involved) .sh prompt> chmod 755 script. E. + E. keeping all other (not involved) permissions. E. "o+t" sets sticky bit for a file s Sets SUID or SGID.go=rx script.1. Examples Here are the examples of the chmod command.g+rx.g. e.o+rx. Result: File changing permissions are studied now.: "u+s" sets SUID. Adds certain thing[s] to the permissions. 2.g. this example doesn't touch read and write permissions.g. "a+x" allows execution of the file for everyone.g. "a=rw". sets read and write permissions and disables execution for all Removes certain thing[s] from the permissions.g-w.o=rx script.g=rx.o-w script.= Assigns the permissions.permissions.go+rx.

to distinguish it from a copyright.Experiment No 5 Aim: Execute shell commands through vi editor. and can be freely modified. If tweaked. Procedure: Linux is developed under the GNU Public License. It means that any recent computer will do. If you make changes to the programs . and then sell your modified version without making the source code available. you have to make those changes available to everyone. make a few changes. however. developed. Common vi editor command list For this Purpose Use this vi Command Syntax . Typical installation takes about 3GB (will all desktop applications. Under GPL the source code is available to anyone who wants it. however. but 600MHz with 256 or 512MB of RAM gives comfort. This basically means you can't take the Linux source code. There are only a few restrictions on the use of the code. it would run. like OpenOffice). Hardware Reuirement: Desktop requirements are higher. This is sometimes referred to as a "copyleft". on 200MHz with 64MB of RAM. and so forth.

g. type as /shri) To continue with search n To search for specified word in backward esc + ?word (Press 'escape' key. for e. type word- direction to-find) To copy the line where cursor is located esc + yy To paste the text just deleted or copied at the cursor esc + p To delete entire line where cursor is located esc + dd To delete word from cursor position esc + dw esc + :$s/word-to-find/word-to-replace/g To Find all occurrence of given word and For. :!pwd . cp or date etc within vi esc + :$s/word-to-find/word-to-replace/cg esc + :!shell-command For e. :$s/mumbai/pune/g Replace then globally without confirmation Here word "mumbai" is replace with "pune" To Find all occurrence of given word and Replace then globally with confirmation To run shell command like ls.g. e.g.To insert new text To save file esc + i ( You have to press 'escape' key then 'i') esc + : + w (Press 'escape' key then 'colon' and finally 'w') To save file with file name (save as) esc + : + w "filename" To quit the vi editor esc + : + q To quit without saving esc + : + q! To save and quit vi editor esc + : + wq To search for specified word in forward direction esc + /word (Press 'escape' key. to find word 'shri'. type /wordto-find.

since script 'first' is in /home/vivek directory. if you notice that all of our programs (in form of executable files) are marked as executable and can be directly executed from prompt from any directory. For e. How its possible? All our executables files are installed in directory called /bin and /bin directory is set in your PATH setting.g.c $ cal etc. if found . what shell do is it first look that command in its internal part (called as internal command. one need to have in the same directory where the creator created its script. (To see executables of our normal program give command $ ls -l /bin ) By typing commands like $ bc $ cc myprg. after creation of this script he moved to some other directory lets say /home/vivek/Letters/Personal. this take time and you have to remember complete path. Home directory is ( use $ pwd to see current working directory) /home/vivek.How Shell Locates the file To run script. Now when you type name of any command at $ prompt. There is another way. Now if he try to execute its script it will not run. which is part of Shell itself. to overcome this problem there are two ways first.. if he are in different directory your script will not run (because of path settings). specify complete path of creator script when ever he want to run it from other directories like giving following command $ /bin/sh /home/vivek/first Now every time you have to give all this detailed as you work in other directory. Then the creator created one script called 'first'. and always available to execute).

When a command is enclosed in backquotes. . if not found. If not found It will look for current directory. $ cd $ mkdir bin $ cp first ~/bin $ first Each of above commands can be explained as follows: Each of above command $ cd Explanation Go to your home directory Now created bin directory. if found shell will execute command from current directory. Yes you can. for this purpose create bin directory in your home directory and then copy your tested version of shell script to this bin directory. then Shell will Look PATH setting. the command get executed and we will get output. so that script can be run as independent program or can be accessed from any directory $ cp first ~/bin $ first copy your script 'first' to your bin directory Test whether script is running or not (It will run) Now consider following command $($ echo 'expr 6 + 3') The command ($ echo 'expr 6 + 3') is know as Parameter substitution. otherwise it will give message "bash: xxxx :command not found". Still there is one question remain can I run my shell script same as these executables?. if found it will execute it. After this you can run you script as executable file without using command like $ /bin/sh /home/vivek/first Command to create you own bin directory. to install your $ mkdir bin own shell script.as internal command shell will execute it. and try to find our requested commands executable file in all of the directories mentioned in PATH settings.

rmp /home/vivek/soft/artical/linux/lsst Instead of giving above command I can give command as follows $cp /mnt/cdrom/lsoft/samba*.rmp `pwd` Here file is copied to your working directory. $pwd $cp /mnt/cdrom/lsoft/samba*.g.rmp `pwd` Result: Shell commands are executed through vi editor. . See the last Parameter substitution of `pwd` command.Mostly this is used in conjunction with other commands.rmp `pwd` Now suppose we are working in directory called "/home/vivek/soft/artical/linux/lsst" and I want to copy some samba files from "/mnt/cdrom/lsoft" to my current working directory. For e. then my command will be something like $cp /mnt/cdrom/lsoft/samba*. expand it self to /home/vivek/soft/artical/linux/lsst. This will save my time. $cp /mnt/cdrom/lsoft/samba*.

JCL. It means that any recent computer will do. of an operating system. Many shell script interpreters double as command line interface. or command line interpreter. Others. and printing text. Procedure: I. If tweaked. Other examples of programming languages primarily intended for shell scripting include DCL and. but 600MHz with 256 or 512MB of RAM gives comfort. Theory: A shell script is a script written for the shell. on 200MHz with 64MB of RAM. Hardware & Software requirement: Desktop requirements are higher. Windows PowerShell or the MS-DOS COMMAND. however. such as AppleScript or the graphical Windows Script Host (WScript. It is often considered a simple domain-specific programming language. it would run. program execution. such as the various Unix shells. Typical installation takes about 3GB (will all desktop applications. Typical operations performed by shell scripts include file manipulation. Flowchart: .exe). add scripting capability to computing environments without requiring a command line interface.Experiment NO: 6 Aim: To write a shell script that accepts any number of arguments and print them in reverse order. like OpenOffice).COM. however.

-1. adding each character to revStr for i in range(len(theStr)-1.(II) Algorithm: text = raw_input("Enter the string: ") print "Reversed string: " + reverseIt(text) def reverseIt(theStr): revStr = "" # initially the reversed string is empty # loop through theStr backwards. -1): revStr += theStr[i] # return the reversed string from the function return revStr+ (III) Coding: .

echo enter any number read n rev=0 sd=0 while [ $n -gt 0 ] do sd=`expr $n % 10` rev=`expr $rev \* 10 + $sd` n=`expr $n / 10` done echo "reverse number is $rev" Result: shell script that accepts any number of arguments and print them in reverse has been written. .

but 600MHz with 256 or 512MB of RAM gives comfort. test it. like OpenOffice). and then return to the editor. and without having to wait for a user to trigger each stage of the sequence. Procedure: I. pause the editor. It means that any recent computer will do./build to create the updated program.Experiment NO: 7 Aim: To write a shell script to find the smallest of three numbers that are read from the keyboard. in a directory with three C source code files. however. Typical installation takes about 3GB (will all desktop applications. Since the 1980s or so. Hardware & Software requirement:: Desktop requirements are higher. which would compile them automatically. Theory: Shell scripts allow several commands that would be entered manually at a command line interface to be executed automatically. scripts of this type have been replaced with utilities like make which are specialized for building programs. and then just run . If tweaked. rather than manually running the four commands required to build the final program from them. one could instead create a C shell script. it would run. on 200MHz with 64MB of RAM. however. here named build and kept in the directory with them. however. Flowchart: .The script would allow a user to save the file being edited. For example.

b. then small = b If c < small. smallest element in the sequence a. .c Input values Small = a If b < small. then small = c (III) Coding: echo Enter 3 numbers with spaces in between read a b c s=$a if [ $b -lt $s ] then s=$b fi if [ $c -lt $s ] then s=$c fi echo Smallest of $a $b $c is $s Result: shell script to find the smallest of three numbers that are read from the keyboard hasbeen written.c Output: small.(II) Algorithm: Input: a.b.

You obtain the latest Gridgen executable either by downloading them from Pointwise’s ftp site or from a CD. major Gridgen version is released. It means that any recent computer will do. Tutorial Workbook.This directory contains the Gridgen User Manual. Typical installation takes about 3GB (will all desktop applications. • A Maintenance Release Installation involves replacing your current Gridgen executable program files with the latest Gridgen executable files. Glyph Reference Manual. but 600MHz with 256 or 512MB of RAM gives comfort. and Gridgen Release Notes and Installation Instructions in PDF and HTML formats in the PDF/ and Help/ subdirectories respectively. however. • A First Time Installation involves extracting both Gridgen and its license managers from a CD and is performed by new users who are using Gridgen for the first time or by existing Gridgen users when a new. on 200MHz with 64MB of RAM. HTML files may be viewed by pressing Help within Gridgen. Theory: There are two types of Gridgen installations: a First Time Installation and a Maintenance Release Installation. . like OpenOffice). PDF files may be viewed and printed using Adobe Acrobat Reader.Experiment NO: 8 Aim: Installation.configuration and customizations of Unix/Linux Hardware & Software requirement:: Desktop requirements are higher. however. A typical Gridgen installation will result in the following layout of data (approximately 200 MBytes) in the gridgen_home_path directory: • doc/ . If tweaked. it would run.

There is not a directory actually named hw.history .pinerc bin store public_html $ The dot files you need to change depend on which shell you are using and which application programs you are using. • utils/ .• examples/ . • licenses/ . database. • gridgen . and linux. sun.. Like many things in Unix. Instead of hw you may see directories called sgi65. These files are sometimes called "dot files.SH ." These files are checked when you log in to your account or start up a session at the Unix shell. Hardware brand specific files for the license managers. and Glyph script (.glf) files for tutorials and other examples of Gridgen usage.This directory contains Glyph scripts that perform various utility functions. Dot files Files for customization usually start with a ". .This directory contains Gridgen (. hw/ . You can find out what shell you are using like this: $ echo $SHELL /bin/csh $ . It is included here in a generic sense to represent the specific hardware brand(s) of computer on which you will install Gridgen and its license managers. there are hundreds and hundreds of customizations you could possibly make.This directory is where we strongly recommend that you install your license file.gg).This file is Gridgen’s Launch Script. You can find what dot files you have in your home directory by this list command: $ ls -a . ." (period). In order to make a customization. library files.plan cmc-html . you need to first know exactly what you can change.This file is Gridgen License Control Script. • LICENSE_CONTROL.forward . and executables will be contained here within subdirectories.cshrc . hp.

For users with a licensed NCR. You can use the Unix setenv command to set the values of these right at the shell prompt. Environment variables that exist system-wide and are used by Unix to function for you. Generates your host ID and host name 4.Kinds of customizations in dot files When you customize your account in a dot file. Starts. Extracts the license managers files from the CD 3. 3. the install script can also perform these additional tasks: 6. Variables you create. the NCR host ID (task 6) must be reported in addition to the Gridgen host ID and hostname to receive an appropriate license file. 4. also called "aliases. . 5. stops. Extracts Gridgen’s files from the CD 2. Generates your NCR host ID 7. or queries the FLEXlm license server (uses the daemon lmgrd) If you have licensed an NCR. you usually are altering or setting the value of some variable. Check out this list of environment variables (in Appendix II. (II) Algorithm: The Install Script performs many tasks: 1." These aliases are a way that you can create shortcut names for commands or other things that you might want to use on a command line. stops. These variables might be: 1. about two-thirds down the page). or you can use the setenv command within the proper dot file to set these environment variables. or queries the NCR license server You are responsible for reporting the host ID and host name to us between tasks 3 and 4. Starts. Imports your NCR license file 8. 2. Imports your Gridgen license file 5. Use the Unix env command to look at these.

embedded devices Available language(s) Multilingual Available programming languages(s) Many . Enter key.6.0-rc5 (28 June 2011. the installation directory should be created under /home.2 (23 June 2011. This first prompt is for the directory into which Gridgen will be installed. Linus Torvalds and many others Programmed in Assembly language. The default installation directory is /usr/local/ gridgen but you are free to choose any existing directory for which you have write privilege. This directory is Gridgen’s home directory. Note: If your server is an SGI Prism workstation.(III) Coding: When first started the Install Script’s main menu will be displayed. 7 days ago (2011-06-23))[2] [+/−] Latest unstable release 3. servers. called gridgen_home_path for short. The installation directory must exist before you enter its name here or else the Install Script will exit. Configuration Company / developer GNU Project. C OS family Unix-like Working state Current Source model Free and open source software Latest stable release 2.39. 2 days ago (2011-06-28))[3] [+/−] Marketing target Desktops.

Xtensa Kernel type Monolithic Userland GNU and others Default user interface Graphical (X Window System) and command-line interface License Various including GNU General Public License. SPARC. SuperH. Microblaze. ARM. FR-V. and others[4] Result: Installation. Itanium. PA-RISC. TILE64. MN103. M32R. s390. PowerPC.configuration and customizations of Unix/Linux has been done. Blackfin. ETRAX CRIS. x86. AVR32. MIT License. H8/300. . MIPS. Unicore32. BSD License. Apache License. S+core.Supported platforms DEC Alpha. m68k.

SOCKS Theory: Internet firewalls are intended to keep the flames of Internet hell out of your private LAN. The TIS Firewall Toolkit (FWTK) 3. ISDN. network connections (LAN Cards. If you will have 50 or more concurrent users I'm guessing you will need: 1. This is because for every user that connects to the system it will be creating another process.-) . a two gig hard disk to store all the logs 3. a Pentium II with 64meg of memory 2.Experiment NO: 9 Aim: Study and installation of Firewall and Proxy server Hardware requirement: 1. monitor and keyboard With some systems by using a serial port console. If you need a proxy server that will handle lots of traffic. you can even eliminate the monitor and keyboard. a 486-DX66 with 32 meg of memory 2. Or. you don't need any special software. Linux will do If you want to setup a proxy server you will need one of these packages. a 250m hard disk (500 recommended) 3. . even modems). two network connections 4. Squid 2. Wireless?) 4. 1. Serial Ports. you should get the largest system you can afford. Software requirement: ● Selecting a Kernel ● Selecting a proxy server To create a filtering firewall. monitor and keyboard The network connections can be any type (NIC cards. to keep the members of your LAN pure and chaste by denying them access the all the evil Internet temptations.

Filtering Firewalls . For example. They are also more difficult to install and maintain than firewalls.that make network connections for you. A proxy server is one that receives requests intended for another server and that acts on the behalf of the client (as the client proxy) to obtain the requested service. you could use Xwindows to run Netscape's browser on the firewall system and have the display on your work station. Linux ipchains is a rewrite of the Linux IPv4 firewalling code and a rewrite of ipfwadm. Using this feature. The proxy server may also be used for caching purposes which enables faster access to frequently used websites. network administrators can bar access to illegal domains but allow access to other sites.The first computer firewall was a non-routing Unix host with connections to two different networks. cannot see Web domain names inside those messages. Likewise for incoming data traffic. Ordinary firewalls. All the computers connected to the LAN access the Internet through a single IP address which results in improved security simply because the number of ports exposed is reduced. You then used the resources of the system to access the Internet.that block selected network packets. 1. Since proxy servers function at the OSI Application layer. ordinary routers can filter by port number or network address. It may also be used for screening purposes to enable the administrator to control access to undesirable sites. Proxy Servers (sometimes called firewalls) . as proxy functionality for each application protocol like HTTP. With the browser running on the firewall it has access to both networks. One network card connected to the Internet and the other to the private LAN. For example. A proxy server is often used when the client and the server are incompatible for direct connection. their filtering capabilities are relatively intelligent. a properly configured proxy server improves network security and performance. . you had to logon to the firewall (Unix) server. proxy web servers can check the URL (Uniform Resource Locator) of outgoing requests for Web pages by inspecting HTTP GET and POST messages. the client may be unable to meet the security authentication requirements of the server but may be required to access some services. For example. in contrast. However. There are two types of firewalls. which was a rewrite of BSD's ipfw. or SOCKS must be configured individually. but proxy servers can also filter based on application content inside the messages. Proxy servers work on the seventh layer (the Application Layer) of the OSI model thus tending to be application dependent unlike firewalls that work at lower layers. To reach the Internet from the private network. SMTP. 2.

. The next two screens require information about your Internet connection. 4. Enter the username and password of the Internet connection to be used. 7. It automatically assigns a unique address to each device on the LAN as internal addresses. The IP address assigned to the modem/router by your ISP is taken as the external address. 5. 3. WinProxy then prompts you to disconnect from the Internet if you are already connected. WinProxy then configures the internal and external IP addresses. Select the type of connection and the name of your connection. The first screen is the product registration screen which require you to enter the product key. 6. In the final step WinProxy works through all the steps and verifies that all operations have been performed properly.Procedure: (I) Flowchart: (II) Algorithm: 1. The operations to work on entire chains are. 2. Run the Install Wizard. Install the TCP/IP protocol on all systems connected to the network.

2. 3. Append a new rule to a chain (-A). List the currently masqueraded connections (-M -L).firewall . There are a few operations for masquerading.1. which are in ipchains for want of a good place to put them: 1. List the rules in a chain (-L).. Delete a rule at some position in a chain (-D). # ipchains -D input 1 # ipchains -D output 1 # ipchains -D forward 1 # Here a duplicate of the above firewall rules in IPChains. make changes . (III) Coding: # ipchains -I input 1 -j DENY # ipchains -I output 1 -j DENY # ipchains -I forward 1 -j DENY . 5. 6. Flush the rules out of a chain (-F). 4. 4. (-P). There are several ways to manipulate rules inside a chain: 1. 2. Replace a rule at some position in a chain (-R).. Create a new chain (-N). There are some timing issues involved in altering firewall rules. Delete the first rule that matches in a chain (-D). 3. Zero the packet and byte counters on all rules in a chain (-Z). Insert a new rule at some position in a chain (-I). Set masquerading timeout values (-M -S). 5.. 2. #!/bin/sh # # rc. Delete an empty chain (-X).. A simplistic approach is to do the following coding. Change the policy for a built-in chain.

0.0/24 -j ACCEPT ## If you are using masquerading # don't masq internal-internal traffic /sbin/ipchains -A forward -s 192.0.0/24 -d 192.2.11 1024: -j ACCEPT # Allow Web connections to outside Web Server /sbin/ipchains -A my-chain -s 192.0.0.1.94.0/0 www -d 192.0.0/0 www -j ACCEPT # Allow DNS traffic /sbin/ipchains -A my-chain -p UDP -s 0.0/24 -d 0.1. .2.0/0 smtp -d 192.0.0/0 dns -d 192.10 -d 0.0/24 -d 0.0/24 -j ACCEPT # don't masq external interface direct /sbin/ipchains -A forward -s 24.2.1.2.0.1.0/0 -j MASQ ## Deny everything else /sbin/ipchains -P my-chain input DENY Result: Study and installation of Firewall and Proxy server has been done.0/0 smtp -j ACCEPT # Allow Web connections to your Web Server /sbin/ipchains -A my-chain -s 0.0.0.0.0/24 1024: -d 0.1.1.0.0/0 -j ACCEPT # masquerade all internal IP's going outside /sbin/ipchains -A forward -s 192.# ## Flush everything.1.0.10 1024:-j ACCEPT # Allow email connections to outside email servers /sbin/ipchains -A my-chain -s 192.0/24 -d 0.2. start from scratch /sbin/ipchains -F input /sbin/ipchains -F output /sbin/ipchains -F forward ## Redirect for HTTP Transparent Proxy #$IPCHAINS -A input -p tcp -s 192.0.2.1.1.2.0.2.0.1.0.0/0 80 -j REDIRECT 8080 ## Create your own chain /sbin/ipchains -N my-chain # Allow email to got to the server /sbin/ipchains -A my-chain -s 0.2.

For this reason. Each root name server knows about the name servers responsible for a given top level domain.name. These root name servers manage the top level domains and are run by the Network Information Center (NIC). DNS can do more than just resolve hostnames. . This quickly proved to be impractical in the face of the rapidly growing number of computers connected to the Internet. . In the early days of the Internet (before 1990). The latter also includes the top level domain or TLD (com). longer TLDs were introduced in 2000 that represent certain spheres of activity (for example. Consider a complete name. This database. consists of a hostname and a domain name (example. independent of the IP address hierarchy described above. The name server also knows which host is receiving e-mails for an entire . TLD assignment has become quite confusing for historical reasons. In addition to that. A full name. The names make up a hierarchical system in which each name component is separated by dots. Information about top level domain NICs is available at http://www. a decentralized database was developed to store the hostnames in a widely distributed manner.domain. does not have the data pertaining to all hosts in the Internet readily available.net.Experiment NO: 10 Aim: Implementation of DNS. In the rest of the world. such as earth. Traditionally. the file /etc/hosts was used to store the names of all the machines represented over the Internet. In Linux. The name hierarchy is. referred to as a fully qualified domain name (FQDN).com). the two-letter ISO national codes are the standard. similar to the name server. The top of the hierarchy is occupied by root name servers.info. The machine that takes care of this conversion is called a name server.museum). LDAP services Theory: DNS assists in assigning an IP address to one or more names and assigning a name to an IP address. this conversion is usually carried out by a special type of software known as bind. . three letter domain names are used in the USA. however.example.com .internic. written in the format hostname. but can dispatch requests to other name servers.

127. LDAP can be thought of as a specialised database which handles trees.domain—the mail exchanger (MX).myco primary 0.0. navigating LDAP fields is like navigating a directory. This clarifies the words Directory and Access. For your machine to resolve an IP address. Added to this LDAP has been designed mainly for optimal access.arp named. The two next entries are for reverse lookups.rev The first line defines the base directory to be used. primary named.192.arp named.168.local primary 1.boot file: directory cache /var/named . The protocol allows access to data in a tree-like structure using attributes. LDAP stands for Lightweight Directory Access Protocol. Setting up a DNS Server One can use the named-bootconf. The third line is optional and contains records for the local LAN.ca file will contain a list of DNS IP addresses for querying external addresses.pl utility to convert old configuration files.ca myco. The name.in-addr. Since directories are also trees.in-addr. The /etc/named. it must know about at least one name server and its IP address.Terminology used in DNS are DIT The Data Information Tree DN Distinguished Name RDN Relative Distinguished Name LDIF LDAP Data Interchange Format (I) Flowchart: .org named.

pl migrate_all_netinfo_offline.pl migrate_netgroup_byuser.pl MigrationTools.pl migrate_netgroup_byhost.pl migrate_all_online.sh migrate_protocols.sh migrate_slapd_conf.spec migrate_group.pl ads migrate_netgroup.pl migrate_all_nis_online.pl migrate_aliases.ph Make.pl migrate_all_netinfo_online.sh migrate_profile.sh migrate_rpc.sh migrate_services.txt migrate_common.pl migrate_all_nisplus_offline.sh migrate_networks.sh (III) Coding: .pl CVSVersionInfo.pl migrate_all_nis_offline.pl migrate_all_nisplus_online.sh migrate_passwd.pl migrate_all_offline.rules migrate_fstab. migrate_automount.pl README migrate_hosts.(II) Algorithm: Files which should be there for creating LDAP directories.pl migrate_base.

LDAP services has been done.dc=com” -W Enter LDAP Password: Result: Implementation of DNS.conf to be rootdn "cn=Manager.ldif -x -D “dc=example.dc=example.The password is generated from the command line as follows sldappasswd New password: Re-enter new password: {SSHA}XyZmHH1RlnSVXTj87UvxOAOCZA8oxNCT We next choose the rootdn in /etc/openldap/slapd.dc=com" rootpw {SSHA}XyZmHH1RlnSVXTj87UvxOAOCZA8oxNCT The next line will update the LDAP entries ldapmodify -f passwd. .