Sandy Report

289 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
289
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Sandy Report

  1. 1. ACKNOWLEDGEMENT <ul><li>The special thank goes to my helpful course coordinator Mr kausik Mondal The support that he gave truly help the progression and smoothness of the internship program. The co-operation is much indeed appreciated. </li></ul><ul><li>My grateful thanks also go to both librarian and lab assistant. A big contribution and hard worked from both of you during the FIVE week is very great indeed. All projects during the program would be nothing without the enthusiasm and imagination from both of you. Besides, this internship program makes me realized the value of working together as a team and as a new experience in working environment, which challenges us every minute. Not forget, great appreciation go to the rest of CMC's staff that help me from time to time during the project. The whole program really brought us together to appreciate the true value of friendship and respect of each other </li></ul><ul><li>Great deals appreciated go to the contribution of my faculty - Faculty of Management (FOM). I am also would like to thankful the Coordinator of CMC (FOM) - Mr. S.NANDY, Assistant Director of CMC, and all the staff in the CMC office that patient in helping us complete this program. </li></ul><ul><li>Last but not least I would like to thank my friends especially those who work together as interns at CMC– X & Y for the wise idea throughout the project. </li></ul>
  2. 2. CONTENT <ul><li>Basic networking </li></ul><ul><li>Ip addressing </li></ul><ul><li>Tcp-ip model </li></ul><ul><li>Topology </li></ul><ul><li>Linux </li></ul><ul><li>RHEL4 </li></ul><ul><li>RHEL4:basic command,installation,configuration </li></ul><ul><li>Group ownership </li></ul><ul><li>File permission </li></ul><ul><li>Linux file system & handling </li></ul><ul><li>Linux user administration </li></ul><ul><li>Linux services & configuration </li></ul><ul><li>FTP server,telnet,squid,web server,mail sever,DHCP,samba </li></ul><ul><li>Concept of virtualization & implementation </li></ul><ul><li>Project on Mail server & Webserver </li></ul>
  3. 3. RHEL4(RED HAT LINUX ENTERPRISE VER 4) <ul><li>BASIC COMMAND: </li></ul><ul><li>A> FILE MANAGEMENT AND MANIPULATION: </li></ul><ul><li>Copy Files: cp </li></ul><ul><li>The cp command is used to copy files. It has a substantial number of options. See its man </li></ul><ul><li>page for additional details. By default, this command works silently, only displaying </li></ul><ul><li>status information if an error condition occurs. Following are the most common options </li></ul><ul><li>for cp : </li></ul><ul><li>Option for cp Description </li></ul><ul><li>-f Forces copy; does not ask for verification </li></ul><ul><li>-I Interactive copy; before each file is copied, verifies with user </li></ul>
  4. 4. <ul><li>First, let’s use the touch command to create an empty file called kumar .txt in the user </li></ul><ul><li>yyang’s home directory. Type </li></ul><ul><li>[root@sandeep ~]# touch foo.txt </li></ul><ul><li>To use the cp (copy) command to copy foo.txt to foo.txt.html , type </li></ul><ul><li>[root@sandeep ~]# cp foo.txt foo.txt.html </li></ul><ul><li>To interactively copy all files ending in .html to the /tmp directory, type this </li></ul><ul><li>command: </li></ul><ul><li>[root@sandeep ~]# cp -i *.html /tmp </li></ul>
  5. 5. <ul><li>Move Files: mv </li></ul><ul><li>The mv command is used to move files from one location to another. Files can be moved </li></ul><ul><li>across partitions/file systems as well. Moving files across partitions involves a copy </li></ul><ul><li>operation, and as a result, the move command may take longer. But you will find that </li></ul><ul><li>moving files within the same file system is almost instantaneous. Following are the most </li></ul><ul><li>common options for mv : </li></ul><ul><li>Option for mv Description </li></ul><ul><li>-f Forces move </li></ul><ul><li>-I Interactive move </li></ul><ul><li>To move a file named foo.txt.html from /tmp to your present working directory, use </li></ul><ul><li>this command: </li></ul><ul><li>[root@sandeep ~]# mv /tmp/foo.txt.html . </li></ul>
  6. 6. <ul><li>Display a File One Screen at a Time: more </li></ul><ul><li>The more command works in much the same way the DOS version of the program does. </li></ul><ul><li>It takes an input file and displays it one screen at a time. The input file can come either </li></ul><ul><li>from its stdin or from a command-line parameter. Additional command-line parameters, </li></ul><ul><li>though rarely used, can be found in the man page. </li></ul><ul><li>To view the /etc/passwd file one screen at a time, use this command: </li></ul><ul><li>[root@sandeep ~]# more /etc/passwd </li></ul><ul><li>To view the directory listing generated by the ls command one screen at a time, </li></ul><ul><li>enter </li></ul><ul><li>[root@sandeep ~]# ls | more </li></ul>
  7. 7. <ul><li>Show the Directory Location of a File: which </li></ul><ul><li>The which command searches your entire path to find the name of an executable specified </li></ul><ul><li>on the command line. If the file is found, the command output includes the actual </li></ul><ul><li>path to the file. </li></ul><ul><li>Use the following command to find out which directory the binary for the rm command </li></ul><ul><li>is located in: </li></ul><ul><li>[root@sandeep ~]# which rm </li></ul><ul><li>/bin/rm </li></ul><ul><li>You may find this similar to the find command. The difference here is that since </li></ul><ul><li>which only searches the path, it is much faster. Of course, it is also much more limiting </li></ul><ul><li>than find , but if all you’re looking for is a program, you’ll find it to be a better choice </li></ul><ul><li>of commands. </li></ul>
  8. 8. <ul><li>Disk Free: df </li></ul><ul><li>The df program displays the amount of free space partition by partition (or volume by </li></ul><ul><li>volume). The drives/partitions must be mounted in order to get this information. Network </li></ul><ul><li>File System (NFS) information can be gathered this way as well. Some parameters </li></ul><ul><li>for df are listed here; additional (rarely used) options are listed in the df manual page. </li></ul><ul><li>Option for df Description </li></ul><ul><li>-h Generates free-space amount in human-readable numbers </li></ul><ul><li>rather than free blocks. </li></ul><ul><li>-l Lists only the locally mounted file systems. Does not display </li></ul><ul><li>any information about network-mounted file systems. </li></ul>
  9. 9. <ul><li>Create a Directory: mkdir </li></ul><ul><li>The mkdir command in Linux is identical to the same command in other flavors of UNIX, </li></ul><ul><li>as well as in MS-DOS. An often-used option of the mkdir command is the -p option. </li></ul><ul><li>This option will force mkdir to create parent directories if they don’t exist already. </li></ul><ul><li>Show Present Working Directory: pwd </li></ul><ul><li>It is inevitable that you will sit down in front of an already logged-in workstation and </li></ul><ul><li>not know where you are in the directory tree. To get this information, you need the pwd </li></ul><ul><li>command. Its only task is to print the current working directory. To display your current </li></ul><ul><li>working directory, use this command: </li></ul><ul><li>[root@sandeep ~]# pwd </li></ul><ul><li>/home/yyang </li></ul>
  10. 10. <ul><li>Who Is Logged In: who </li></ul><ul><li>On systems that allow users to log into other users’ machines or special servers, you </li></ul><ul><li>will want to know who is logged in. You can generate such a report by using the who </li></ul><ul><li>command: </li></ul><ul><li>[root@sandeep ~]# who </li></ul><ul><li>yyang pts/0 2010-10-08 15:24 (10.35.35.51) </li></ul><ul><li>yyang pts/1 2010-10-08 16:07 (10.35.35.51) </li></ul><ul><li>A Variation on who: w </li></ul><ul><li>The w command displays the same information that who does and a whole lot more. </li></ul><ul><li>The details of the report include who is logged in, what their terminal is, where they are </li></ul><ul><li>logged in from, how long they’ve been logged in, how long they’ve been idle, and their </li></ul><ul><li>CPU utilization. The top of the report also gives you the same output as the uptime </li></ul><ul><li>command. </li></ul><ul><li>[root@sandeep ~]# w </li></ul><ul><li>16:11:24 up 1:10, 2 users, load average: 0.04, 0.01, 0.00 </li></ul><ul><li>USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT </li></ul><ul><li>yyang pts/0 192.168.99.51 15:24 0.00s 0.12s 0.01s w </li></ul><ul><li>yyang pts/1 192.168.99.51 16:07 3:35 0.04s 0.04s -bash </li></ul>
  11. 11. EDITORS <ul><li>vi </li></ul><ul><li>The vi editor has been around UNIX-based systems since the 1970s, and its interface </li></ul><ul><li>shows it. It is arguably one of the last editors to actually use a separate command mode </li></ul><ul><li>and data entry mode; as a result, most newcomers find it unpleasant to use. But before </li></ul><ul><li>you give vi the cold shoulder, take a moment to get comfortable with it. In difficult </li></ul><ul><li>situations, you may not have a pretty graphical editor at your disposal, and vi is ubiquitous </li></ul><ul><li>across all UNIX systems. </li></ul><ul><li>The version of vi that ships with Linux distributions is vim (VI iMproved). It has a </li></ul><ul><li>lot of what made vi popular in the first place and many features that make it useful in </li></ul><ul><li>today’s typical environments (including a graphical interface if the X Window System is </li></ul><ul><li>running). </li></ul><ul><li>To start vi , simply type </li></ul><ul><li>[root@sandeep ~]# vi </li></ul>
  12. 12. Creating Users with useradd <ul><li>Add new user accounts and assign passwords with the useradd and passwd </li></ul><ul><li>commands. </li></ul><ul><li>1. Create a new user whose full name is “Ying Yang,” with the login name (account </li></ul><ul><li>name) of yyang . Type </li></ul><ul><li>[root@sandeep ~]# useradd -c &quot;Ying Yang&quot; yyang </li></ul><ul><li>This command will create a new user account called yyang. The user will be </li></ul><ul><li>created with the usual Fedora default attributes. The entry in the /etc/passwd </li></ul><ul><li>file will be </li></ul><ul><li>yyang:x:500:500:Ying Yang:/home/yyang:/bin/bash </li></ul><ul><li>From this entry, you can tell these things about the Fedora (and RHEL) default </li></ul><ul><li>new user values: </li></ul><ul><li>▼ The UID number is the same as the GID number. </li></ul><ul><li>■ The default shell for new users is the bash shell ( /bin/bash ). </li></ul><ul><li>▲ A home directory is automatically created for all new users (e.g., /home/ </li></ul><ul><li>yyang ). </li></ul><ul><li>2. Use the passwd command to create a new password for the username </li></ul><ul><li>yyang. Set the password to be 19ang19 , and repeat the same password when </li></ul><ul><li>prompted. Type </li></ul><ul><li>[root@sandeep ~]# passwd yyang </li></ul><ul><li>Changing password for user yyang. </li></ul><ul><li>New UNIX password: </li></ul><ul><li>Retype new UNIX password: </li></ul><ul><li>passwd: all authentication tokens updated successfully </li></ul>
  13. 13. Creating Groups with groupadd <ul><li>Next, create a couple of groups: nonsystem and system. </li></ul><ul><li>1. Create a new group called research . Type </li></ul><ul><li>[root@sandeep ~]# groupadd research </li></ul><ul><li>2. Examine the entry for the research group in the /etc/group file. Type </li></ul><ul><li>[root@sandeep ~]# grep research /etc/group </li></ul><ul><li>research:x:501: </li></ul><ul><li>This output shows that the group ID for the research group is 501. </li></ul>
  14. 14. Modifying User Attributes with usermod <ul><li>Now try using usermod to change the user and group IDs for a couple of accounts. </li></ul><ul><li>1. Use the usermod command to change the user ID (UID) of the bogususer to </li></ul><ul><li>600. Type </li></ul><ul><li>[root@sandeep ~]# usermod -u 600 bogususer </li></ul><ul><li>2. Use the id command to view your changes. Type </li></ul><ul><li>[root@sandeep ~]# id bogususer </li></ul><ul><li>The output shows the new UID (600) for the user. </li></ul><ul><li>3. Use the usermod command to change the primary group ID (GID) of the bogususer </li></ul><ul><li>account to that of the bogus group (GID = 101) and to also set an expiry date </li></ul><ul><li>of 12-12-2010 for the account. Type </li></ul><ul><li>[root@sandeep ~]# usermod -g 497 -e 2010-12-12 bogususer </li></ul><ul><li>4. View your changes with the id command. Type </li></ul><ul><li>[root@sandeep ~]# id bogususer </li></ul><ul><li>5. Use the chage command to view the new account expiration information for </li></ul><ul><li>the user. Type </li></ul><ul><li>[root@sandeep ~]# chage -l bogususer </li></ul><ul><li>Last password change : Sep 23, 2009 </li></ul><ul><li>Password expires : never </li></ul><ul><li>Password inactive : never </li></ul><ul><li>Account expires : Dec 12, 2010 </li></ul><ul><li>Minimum number of days between password change : 0 </li></ul><ul><li>Maximum number of days between password change : 99999 </li></ul><ul><li>Number of days of warning before password expires : 7 </li></ul>
  15. 15. Modifying Group Attributes with groupmod <ul><li>Now try using the groupmod command. </li></ul><ul><li>1. Use the groupmod command to rename the bogus group to bogusgroup . Type </li></ul><ul><li>[root@sandeep ~]# groupmod -n bogusgroup bogus </li></ul><ul><li>2. Again use the groupmod command to change the group ID (GID) of the bogusgroup </li></ul><ul><li>to 600. Type </li></ul><ul><li>[root@sandeep ~]# groupmod -g 600 bogusgroup </li></ul><ul><li>3. View your changes to the bogusgroup in the /etc/group file. Type </li></ul><ul><li>[root@sandeep ~]# grep bogusgroup /etc/group </li></ul>
  16. 16. Deleting Groups and Users with groupdel and userdel <ul><li>Try using the groupdel and userdel commands to delete groups and users, </li></ul><ul><li>respectively. </li></ul><ul><li>1. Use the groupdel command to delete the bogusgroup group. Type </li></ul><ul><li>[root@sandeep ~]# groupdel bogusgroup </li></ul><ul><li>You will notice that the bogusgroup entry in the /etc/group file will be removed </li></ul><ul><li>accordingly. </li></ul><ul><li>2. Use the userdel command to delete the user bogususer that you created previously. </li></ul><ul><li>At the shell prompt, type </li></ul><ul><li>[root@sandeep ~]# userdel -r bogususer </li></ul>
  17. 17. GROUP OWNERSHIP <ul><li>Change Ownership: chown </li></ul><ul><li>The chown command allows you to change the ownership of a file to someone else. Only </li></ul><ul><li>the root user can do this. (Normal users may not give away file ownership or steal ownership </li></ul><ul><li>from another user.) The syntax of the command is as follows: </li></ul><ul><li>[root@sandeep ~]# chown [-R] username filename </li></ul><ul><li>where username is the login of the user to whom you want to assign ownership, and </li></ul><ul><li>filename is the name of the file in question. The filename may be a directory as well. </li></ul><ul><li>The -R option applies when the specified filename is a directory name. This option </li></ul><ul><li>tells the command to recursively descend through the directory tree and apply the new </li></ul><ul><li>ownership, not only to the directory itself, but also to all of the files and directories </li></ul><ul><li>within it. </li></ul>
  18. 18. GROUP OWNERSHIP & FILE PERMISSION (Change Group: chgrp) <ul><li>The chgrp command-line utility lets you change the group settings of a file. It works </li></ul><ul><li>much like chown . Here is the format: </li></ul><ul><li>[root@sandeep ~]# chgrp [-R] groupname filename </li></ul><ul><li>where groupname is the name of the group to which you want to assign filename ownership. </li></ul><ul><li>The filename may be a directory as well. </li></ul><ul><li>The -R option applies when the specified filename is a directory name. As with </li></ul><ul><li>chown , the -R option tells the command to recursively descend through the directory </li></ul><ul><li>tree and apply the new ownership, not only to the directory itself, but also to all of the </li></ul><ul><li>files and directories within it. </li></ul>
  19. 19. <ul><li>GROUP OWNERSHIP & FILE PERMISSION (Change Mode: chmod) </li></ul><ul><li>Directories and files within the Linux system have permissions associated with them. </li></ul><ul><li>By default, permissions are set for the owner of the file, the group associated with the </li></ul><ul><li>file, and everyone else who can access the file (also known as owner, group, and other, </li></ul><ul><li>respectively). When you list files or directories, you see the permissions in the first column </li></ul><ul><li>of the output. Permissions are divided into four parts. The first part is represented </li></ul><ul><li>by the first character of the permission. Normal files have no special value and are represented </li></ul><ul><li>with a hyphen ( - ) character. If the file has a special attribute, it is represented by </li></ul><ul><li>a letter. The two special attributes we are most interested in here are directories ( d ) and </li></ul><ul><li>symbolic links ( l ). </li></ul><ul><li>The second, third, and fourth parts of a permission are represented in three-character </li></ul><ul><li>chunks. The first part indicates the file owner’s permission. The second part indicates </li></ul><ul><li>the group permission. The last part indicates the world permission. In the context of </li></ul><ul><li>UNIX, “world” means all users in the system, regardless of their group settings. </li></ul><ul><li>Following are the letters used to represent permissions and their corresponding values. </li></ul><ul><li>When you combine attributes, you add their values. The chmod command is used </li></ul><ul><li>to set permission values. </li></ul><ul><li>Letter Permission Value </li></ul><ul><li>R Read 4 </li></ul><ul><li>W Write 2 </li></ul><ul><li>X Execute 1 </li></ul>
  20. 20. GROUP OWNERSHIP & FILE PERMISSION <ul><li>The following list shows the most common combinations of the three permissions. </li></ul><ul><li>Other combinations, such as -wx , do exist, but they are rarely used. </li></ul><ul><li>Letter Permission Value </li></ul><ul><li>--- No permissions 0 </li></ul><ul><li>r-- Read only 4 </li></ul><ul><li>Rw- Read and write 6 </li></ul><ul><li>Rwx Read, write, and execute 7 </li></ul><ul><li>r-x Read and execute 5 </li></ul><ul><li>--x Execute only 1 </li></ul>
  21. 21. FILE SYSTEM & HANDLING <ul><li>File systems are the mechanisms by which the data on a storage medium gets </li></ul><ul><li>organized. They provide all of the abstraction layers above sectors and cylinders </li></ul><ul><li>of disks. In this section, we’ll discuss the composition and management of these </li></ul><ul><li>abstraction layers supported by Linux. Particular attention will be given to the default </li></ul><ul><li>Linux file system, ext2/ext3. </li></ul>
  22. 22. The /etc/fstab File <ul><li>As mentioned earlier, /etc/fstab is a configuration file that mount can use. This file contains </li></ul><ul><li>a list of all partitions known to the system. During the boot process, this list is read </li></ul><ul><li>and the items in it are automatically mounted with the options specified therein. </li></ul><ul><li>Here’s the format of entries in the /etc/fstab file: </li></ul><ul><li>/dev/device /dir/to/mount fstype Parameters fs_ freq fs_ passno </li></ul><ul><li>1) /dev/VolGroup00/LogVol00 / ext3 defaults 1 1 </li></ul><ul><li>2) LABEL=/boot /boot ext3 defaults 1 2 </li></ul><ul><li>3) devpts /dev/pts Devpts gid=5,mode=620 0 0 </li></ul><ul><li>4) tmpfs /dev/shm tmpfs defaults 0 0 </li></ul><ul><li>5) /dev/VolGroup00/LogVol02 /home ext3 defaults 1 2 </li></ul><ul><li>6) proc /proc proc defaults 0 0 </li></ul><ul><li>7) sysfs /sys sysfs defaults 0 0 </li></ul><ul><li>8) /dev/VolGroup00/LogVol03 /tmp ext3 defaults 1 2 </li></ul><ul><li>9) /dev/VolGroup00/LogVol01 swap swap defaults 0 0 </li></ul><ul><li>10) /dev/sr0 /media/cdrom auto user,noauto,exec 0 0 </li></ul>
  23. 23. Creating a Partition <ul><li>1. Begin by running fdisk with the -l parameter to list the current partition </li></ul><ul><li>table. Type </li></ul><ul><li>[root@sandeep ~]# fdisk -l /dev/sda </li></ul><ul><li>Disk /dev/sda: 10.7 GB, 10737418240 bytes </li></ul><ul><li>255 heads, 63 sectors/track, 1305 cylinders </li></ul><ul><li>Units = cylinders of 16065 * 512 = 8225280 bytes </li></ul><ul><li>Disk identifier: 0x00005158 </li></ul><ul><li>Device Boot Start End Blocks Id System </li></ul><ul><li>/dev/sda1 * 1 25 200781 83 Linux </li></ul><ul><li>/dev/sda2 26 1200 9438187+ 8e Linux LVM </li></ul><ul><li>2. Next, we begin the actual repartitioning process using fdisk again. Type </li></ul><ul><li>[root@sandeep ~]# fdisk /dev/sda </li></ul><ul><li>The number of cylinders for this disk is set to 1305. </li></ul><ul><li>...(OUTPUT TRUNCATED)... </li></ul><ul><li>2) booting and partitioning software from other operating systems </li></ul><ul><li>(e.g., DOS FDISK, OS/2 FDISK) </li></ul><ul><li>Command (m for help): </li></ul><ul><li>You will be presented with a simple fdisk prompt “Command (m for help):”. </li></ul><ul><li>3. Print the partition table again while inside the fdisk program. Type p at the </li></ul><ul><li>fdisk prompt to print the partition table </li></ul>
  24. 24. Creating a Partition <ul><li>Command (m for help): p </li></ul><ul><li>Disk /dev/sda: 10.7 GB, 10737418240 bytes </li></ul><ul><li>255 heads, 63 sectors/track, 1305 cylinders </li></ul><ul><li>Units = cylinders of 16065 * 512 = 8225280 bytes </li></ul><ul><li>Disk identifier: 0x00005158 </li></ul><ul><li>Device Boot Start End Blocks Id System </li></ul><ul><li>/dev/sda1 * 1 25 200781 83 Linux </li></ul><ul><li>/dev/sda2 26 1200 9438187+ 8e Linux LVM </li></ul><ul><li>A few facts worthy of note regarding this output: </li></ul><ul><li>▼ The total disk size is approximately 10.7GB. </li></ul><ul><li>■ There are currently two partitions defined on the sample system: /dev/sda1 </li></ul><ul><li>and /dev/sda2. </li></ul><ul><li>■ The /dev/sda1 partition is of the type “Linux” (0x83), and the /dev/sda2 </li></ul><ul><li>partition is of the type “Linux LVM” (0x8e). </li></ul>
  25. 25. Creating a Partition <ul><li>■ From the partitioning scheme we chose during the OS installation, we can </li></ul><ul><li>deduce that /dev/sda1 houses the /boot file system and /dev/sda2 houses </li></ul><ul><li>everything else (see the output of the df command for reference). </li></ul><ul><li>■ The entire disk spans 1305 cylinders. </li></ul><ul><li>▲ The last partition, i.e., /dev/sda2, ends at the 1200-cylinder boundary. </li></ul><ul><li>Therefore, there is room to create a partition that will occupy the space from </li></ul><ul><li>cylinder 1201 to the last cylinder on the disk (i.e., 1305). </li></ul><ul><li>4. Type n at the prompt to create a new partition. </li></ul><ul><li>Command (m for help): n </li></ul>
  26. 26. Creating a Partition <ul><li>5. Type p to select a primary partition type. </li></ul><ul><li>Command action </li></ul><ul><li>e extended </li></ul><ul><li>P primary partition (1-4) </li></ul><ul><li>P </li></ul><ul><li>6. We want to create the third primary partition. Type 3 when prompted for a partition </li></ul><ul><li>number: </li></ul><ul><li>Partition number (1-4): 3 </li></ul><ul><li>7. The next step is to specify the partition size. First we choose the lower limit. </li></ul><ul><li>Accept the default value for the first cylinder. Type 1201 . </li></ul><ul><li>First cylinder (1201-1305, default 1201): 1201 </li></ul><ul><li>8. Instead of designating a megabyte value for the size of this partition, we enter </li></ul><ul><li>the last cylinder number, thus taking up the remainder of the disk. Accept the </li></ul><ul><li>default suggested for the last cylinder. On our sample system, this value is 1305. </li></ul><ul><li>Type 1305 . </li></ul><ul><li>Last cylinder or +size or +sizeM or +sizeK (1201-1305, default 1305): </li></ul><ul><li>1305 </li></ul><ul><li>9. By default, fdisk creates ext2-type partitions (i.e., 0x83). But we want to create a </li></ul><ul><li>partition of type “Linux LVM.” Change the partition type from the default Linux </li></ul><ul><li>(0x83) to the “Linux LVM” type. To do this, we use the t (change partition type) </li></ul><ul><li>command. Type t . </li></ul><ul><li>Command (m for help): t </li></ul>
  27. 27. Creating a Partition <ul><li>10. Enter the partition number whose type you want to change. We want to change </li></ul><ul><li>the type for the /dev/hda3 partition that was just created, so type 3 when </li></ul><ul><li>prompted for a partition number. </li></ul><ul><li>Partition number (1-4): 3 </li></ul><ul><li>11. Enter the partition type for “Linux LVM”. Type 8e at the prompt: </li></ul><ul><li>Hex code (type L to list codes): 8e </li></ul><ul><li>12. View the changes you’ve made by viewing the partition table. Type p . </li></ul><ul><li>Command (m for help): p </li></ul><ul><li>Disk /dev/sda: 10.7 GB, 10737418240 bytes </li></ul><ul><li>255 heads, 63 sectors/track, 1305 cylinders </li></ul><ul><li>Units = cylinders of 16065 * 512 = 8225280 bytes </li></ul><ul><li>Disk identifier: 0x00005158 </li></ul><ul><li>Device Boot Start End Blocks Id System </li></ul><ul><li>/dev/sda1 * 1 25 200781 83 Linux </li></ul><ul><li>/dev/sda2 26 1200 9438187+ 8e Linux LVM </li></ul><ul><li>/dev/sda3 1201 1305 843412+ 8e Linux LVM </li></ul><ul><li>13. Once you are satisfied with your changes, commit or write the changes you’ve </li></ul><ul><li>made to the disk’s partition table using the w (write table to disk) command: </li></ul><ul><li>Command (m for help): w </li></ul><ul><li>14. Quit the fdisk utility. Type q . </li></ul><ul><li>Command (m for help): q </li></ul><ul><li>15. When you are back at the shell prompt, reboot the system to allow the Linux </li></ul><ul><li>kernel to properly recognize the new partition table. Type </li></ul><ul><li>[root@sandeep ~]# reboot </li></ul>
  28. 28. The /etc/shadow File <ul><li>Just as in the /etc/passwd file, each line in the /etc/shadow file represents information </li></ul><ul><li>about a user. The lines are made up of various standard fields, with each field delimited </li></ul><ul><li>by a colon. The fields are </li></ul><ul><li>▼ Login name </li></ul><ul><li>■ Encrypted password </li></ul><ul><li>■ Days since January 1, 1970, that password was last changed </li></ul><ul><li>■ Days before password may be changed </li></ul><ul><li>■ Days after which password must be changed </li></ul><ul><li>■ Days before password is to expire that user is warned </li></ul><ul><li>■ Days after password expires that account is disabled </li></ul><ul><li>■ Days since January 1, 1970, that account is disabled </li></ul><ul><li>▲ A reserved field </li></ul><ul><li>A sample entry from the /etc/shadow file is shown here for the user account mmel: </li></ul><ul><li>mmel:$1$HEWdPIJ.$qX/RbB.TPGcyerAVDlF4g.:12830:0:99999:7::: </li></ul>
  29. 29. THE INIT PROCESS <ul><li>The init process is the first non-kernel process that is started, and, therefore, it always gets </li></ul><ul><li>the process ID number of 1. init reads its configuration file, /etc/inittab , and determines </li></ul><ul><li>the runlevel where it should start. Essentially, a runlevel dictates the system’s behavior. </li></ul><ul><li>Each level (designated by an integer between 0 and 6) serves a specific purpose. A runlevel </li></ul><ul><li>of initdefault is selected if it exists; otherwise, you are prompted to supply a </li></ul><ul><li>runlevel value. </li></ul><ul><li>The runlevel values are as follows: </li></ul><ul><li>0 Halt the system </li></ul><ul><li>1 Enter single-user mode </li></ul><ul><li>2 Multiuser mode, but without Network File System (NFS) </li></ul><ul><li>3 Full multiuser mode (normal) </li></ul><ul><li>4 Unused </li></ul><ul><li>5 Same as runlevel 3, except using an X Window System login </li></ul><ul><li>rather than a text-based login </li></ul><ul><li>6 Reboot the system </li></ul>
  30. 30. FTP SERVER <ul><li>The File Transfer Protocol (FTP) has existed for the Internet since around 1971. </li></ul><ul><li>Remarkably, the protocol has undergone little change since then. Clients and </li></ul><ul><li>servers, on the other hand, have been almost constantly improved and refined. </li></ul><ul><li>This chapter covers the Very Secure FTP Daemon ( vsftpd ) software package. </li></ul><ul><li>The vsftpd program is a fairly popular FTP server and is being used by major FTP </li></ul><ul><li>sites such as kernel.org, redhat.com, isc.org, and openbsd.org. The fact that these sites </li></ul><ul><li>run the software attests to its robustness and security. As the name implies, the vsftpd </li></ul><ul><li>software was designed from the ground up to be fast, stable, and secure. </li></ul>
  31. 31. OBTAINING AND INSTALLING VSFTPD <ul><li>First we discuss the process of installing the software from a Red Hat Package Manager </li></ul><ul><li>(RPM) binary. </li></ul><ul><li>1. While logged into the system as the superuser, use the yum command to simultaneously </li></ul><ul><li>download and install vsftpd . Type (enter y for “yes” when prompted) </li></ul><ul><li>[root@sandeep ~]# yum -y install vsftpd </li></ul><ul><li>...<OUTPUT TRUNCATED>... 2. Confirm that the software has been installed. Type </li></ul><ul><li>[root@sandeep ~]# rpm -q vsftpd </li></ul><ul><li>vsftpd-* </li></ul>
  32. 32. Starting and Testing the FTP Server <ul><li>So let’s start a sample anonymous FTP session. But first we’ll start the FTP service. </li></ul><ul><li>1 . Start the FTP service. Type </li></ul><ul><li>[root@serverA ~]# service vsftpd start </li></ul><ul><li>Starting vsftpd for vsftpd: [ OK ] </li></ul><ul><li>2. Launch the command-line FTP client program, and connect to the local FTP </li></ul><ul><li>server as an anonymous user. Type </li></ul><ul><li>[root@serverA ~]# ftp localhost </li></ul><ul><li>Connected to localhost (127.0.0.1). </li></ul><ul><li>220 (vsFTPd 2.0.8) </li></ul><ul><li>Name (localhost:root): </li></ul><ul><li>...<OUTPUT TRUNCATED>... </li></ul><ul><li>3 . Enter the name of the anonymous FTP user when prompted; i.e., type ftp . </li></ul><ul><li>Name (localhost:root): ftp </li></ul><ul><li>331 Please specify the password. </li></ul><ul><li>4. Enter anything at all when prompted for the password. </li></ul><ul><li>Password: </li></ul><ul><li>230 Login successful. </li></ul><ul><li>Remote system type is UNIX. </li></ul><ul><li>Using binary mode to transfer files. </li></ul>
  33. 33. Starting and Testing the FTP Server <ul><li>5. Use the ls (or dir) FTP command to perform a listing of the files in the current </li></ul><ul><ul><li>directory on the FTP server. </li></ul></ul><ul><li>ftp> ls </li></ul><ul><li>227 Entering Passive Mode (127,0,0,1,63,215). </li></ul><ul><li>150 Here comes the directory listing. </li></ul><ul><li>drwxr-xr-x 2 0 0 4096 Aug 29 06:18 pub </li></ul><ul><li>226 Directory send OK. </li></ul><ul><li>6. Use the pwd command to display your present working directory on the FTP </li></ul><ul><li>server. </li></ul><ul><li>ftp> pwd </li></ul><ul><li>257 &quot;/“ </li></ul><ul><li>7. Using the cd command, try to change to a directory outside of the allowed anonymous </li></ul><ul><li>FTP directory; e.g., try to change your directory to the /boot directory of </li></ul><ul><li>the local file system. </li></ul><ul><li>ftp> cd /boot </li></ul><ul><li>550 Failed to change directory. </li></ul><ul><li>8. Log out of the FTP server using the bye FTP command. </li></ul><ul><li>ftp> bye </li></ul><ul><li>221 Goodbye. </li></ul>
  34. 34. SAMBA CONFIGURATION <ul><li>Installing Samba package via RPM </li></ul><ul><li>Precompiled binaries for Samba exist for most Linux distributions. This section will show </li></ul><ul><li>how to install Samba via Red Hat Package Manager (RPM) on a Fedora distribution. To </li></ul><ul><li>provide the server-side services of Samba, three packages are needed on Fedora and Red </li></ul><ul><li>Hat Enterprise Linux (RHEL)–type systems. They are </li></ul><ul><li>▼ samba*.rpm This package provides an SMB server that can be used to provide </li></ul><ul><li>network services to SMB/CIFS clients. </li></ul><ul><li>■ samba-common*.rpm This package provides files necessary for both the </li></ul><ul><li>server and client packages of Samba—files such as configuration files, log files, </li></ul><ul><li>man pages, PAM modules, and other libraries. </li></ul><ul><li>▲ samba-client*.rpm It provides the SMB client utilities that allow access to SMB </li></ul><ul><li>shares and printing services on Linux and non-Linux-type systems. The package </li></ul><ul><li>is used on Fedora, OpenSuSE, and other RHEL-type systems. </li></ul>
  35. 35. SAMBA CONFIGURATION <ul><li>rpm –ivh sam* --force –aid </li></ul><ul><li>If already install rpm –qa sam* </li></ul><ul><li>Create directory : </li></ul><ul><li>Mkdir /samba </li></ul><ul><li>Give write permission: </li></ul><ul><li>Chmod 0+w /samba </li></ul><ul><li>Create a new user: </li></ul><ul><li>Useradd testsamba </li></ul><ul><li>Smbpasswd –a ******* </li></ul><ul><li>Open smb.conf file to edit: </li></ul><ul><li>Vi /etc/samba/smb.conf </li></ul>
  36. 36. Smb.conf file <ul><li>Host allow :172.0. 127 </li></ul><ul><li>Domain logons : yes </li></ul><ul><li>Create account info: </li></ul><ul><li>Path - /samba </li></ul><ul><li>Public- yes </li></ul><ul><li>User-testsamba </li></ul><ul><li>Writable –yes </li></ul><ul><li>Printable-no </li></ul><ul><li>After making any configuration changes to Samba, you can restart it with this command </li></ul><ul><li>to make the changes go into effect: </li></ul><ul><li>[root@sandeep ~]# service smb restart </li></ul><ul><li>Chkconfig smb on </li></ul>
  37. 37. CONFIGURE DISK QUOTA <ul><li>Enter single user mode or GUI mode </li></ul><ul><li>Edit /etc/fstab file </li></ul><ul><li>Add ,usrqouta after defaults in New /etc/fstab file </li></ul><ul><li>LABEL=/ / ext3 defaults,usrquota 1,2 </li></ul><ul><li>Remount file system: </li></ul><ul><li># mount –o remount / </li></ul><ul><li>Create aquota.user or aquota.group files: </li></ul><ul><li>Quotacheck-mcvu / </li></ul><ul><li>Make Linux read the aquota.user file </li></ul><ul><li># quotacheck –vagum </li></ul><ul><li>Modify users quota information </li></ul><ul><li># edquota –u </li></ul><ul><li># setquota –u a 500 1000 10 15 / </li></ul><ul><li>The above command will invoke the vi editor which will allow you to edit a number of fields. </li></ul><ul><li># quotaon –av (to on the disk quota) </li></ul><ul><li># quotaoff –av (to off the disk quota) </li></ul><ul><li># repquota –av (to view the diskquota) </li></ul>
  38. 38. PROJECT ON MAIL SERVER & WEB SERVER <ul><li>CONFIGURE A WEB SERVER SUCH THAT ONLY ONE CAN ACCESS YOUR SERVER AT THE SAME NETWORK </li></ul><ul><li>Host two websites </li></ul><ul><li>www.summertraining.com </li></ul><ul><li>www.linux.com </li></ul><ul><ul><li>DEVELOP INDEX.HTML(Homepage) </li></ul></ul><ul><ul><li>CONFIGURE SMTP & POP & POP3 ,SO THAT ANY ONE CAN SEND OR RECEIVE MAIL THROUGH WEB. </li></ul></ul><ul><ul><li>CONFIGURE ANY MAIL ACCOUNT IN OUTLOOK EXPRESS OR WINDOWS LIVE </li></ul></ul><ul><ul><li>CONFIGURE YOUR SERVER AS A PROXY SERVER SO THAT ANY ONE CAN ACCESS www.summertraining.com BUT NOT ACCESS www.linux.com </li></ul></ul>
  39. 39. PROJECT <ul><li>EDIT /etc/ httpd /conf/ httpd .conf file . </li></ul><ul><li>Then change the following lines: </li></ul><ul><li>#NameVirtualHost *:80 </li></ul><ul><li>#<VirtualHost *:80> </li></ul><ul><li># ServerAdmin webmaster@dummy-host.example.com </li></ul><ul><li># DocumentRoot /summertraining.com </li></ul><ul><li># ServerName www.summertraining.com </li></ul><ul><li># ErrorLog logs/dummy-host.example.com-error_log </li></ul><ul><li># CustomLog logs/dummy-host.example.com-access_log common </li></ul>
  40. 40. PROJECT <ul><li>EDIT /etc/ httpd /conf/ httpd .conf file . </li></ul><ul><li>Then change the following lines: </li></ul><ul><li>#NameVirtualHost *:3128 </li></ul><ul><li>#<VirtualHost *:3128> </li></ul><ul><li># ServerAdmin webmaster@dummy-host.example.com </li></ul><ul><li># DocumentRoot /linux.com </li></ul><ul><li># ServerName www.linux.com </li></ul><ul><li># ErrorLog logs/dummy-host.example.com-error_log </li></ul><ul><li># CustomLog logs/dummy-host.example.com-access_log common </li></ul>
  41. 41. PROJECT <ul><li>After editing /etc/ httpd /conf/ httpd .conf file then make a two directory in root. </li></ul><ul><li>summertraining.com </li></ul><ul><li>linux.com </li></ul><ul><li>Then create index.html1 & index.html2 (homepage) respectively in linux.com & summertraining.com </li></ul><ul><li>Then enter the following command </li></ul><ul><li>[root@sandeep ~]#/etc/init.d/httpd restart </li></ul><ul><li>Then change proxy and port number in my web browser </li></ul><ul><li>Then view the 2 websites. </li></ul>
  42. 42. SQUID CONFIGURATION <ul><li>Configure /etc/squid/squid.conf file </li></ul><ul><li>[root@sandeep ~]#/etc/squid/squid.conf. </li></ul><ul><li>Then change the following line: </li></ul><ul><li>http port :3128 </li></ul><ul><li>#Recommended minimum configuration: </li></ul><ul><li>acl CONNECT method CONNECT </li></ul><ul><li>acl test src 172.0.0.0/255.255.0.0 </li></ul><ul><li>acl blocklist dstdomain www.linux.com </li></ul><ul><li># And finally deny all other access to this proxy </li></ul><ul><li>http_access allow localhost </li></ul><ul><li>http_access allow blocklist </li></ul><ul><li>http_access allow test </li></ul><ul><li>http_access deny all </li></ul><ul><li>After editing the file enter </li></ul><ul><li>[root@sandeep ~]#service squid restart </li></ul><ul><li>Stopping squid: [OK] </li></ul><ul><li>init_cache_dir /var/spool/squid... Starting squid: . [ OK ] </li></ul>
  43. 43. MAIL SERVER <ul><li>Package installation: </li></ul><ul><li>[root@sandeep ~]# rpm -qa sendmail </li></ul><ul><li>sendmail-8.13.1-3.2.el4 </li></ul><ul><li>[root@sandeep ~]# rpm -qa dov* </li></ul><ul><li>dovecot-0.99.11-8.EL4 </li></ul><ul><li>[root@sandeep ~]# rpm -qa squir* </li></ul><ul><li>squirrelmail-1.4.8-4.el4 </li></ul><ul><li>Then go to web browser and type : </li></ul><ul><li>http://127.0.1.88 </li></ul><ul><li>http://127.0.1.88/webmail/src/login.php </li></ul><ul><li>Then enter into it and and send mail to any other user connected,if with same ip then no domain name required,otherwise domainname required. </li></ul>

×