66

Agenda

Embed Size (px)

DESCRIPTION

Agenda. Administrative Issues Link of the Week This Week’s Expected Outcomes Points of interest Moving around in UNIX Break-Out Problems Upcoming Deadlines Hands-on Information Lab Assistance, Questions, and Answers. Announcements - PowerPoint PPT Presentation

Citation preview

Page 1: Agenda
Page 2: Agenda

Agenda

Administrative IssuesLink of the WeekThis Week’s Expected OutcomesPoints of interestMoving around in UNIXBreak-Out ProblemsUpcoming DeadlinesHands-on InformationLab Assistance, Questions, and Answers

Page 3: Agenda

AnnouncementsAnnouncements

AnnouncementsStudents are encouraged to email their

Power Point presentations to me at least three hour prior to the class presentation session. This allows me the opportunity to open your Power Point file and verify that it is usable. Once this check is made, your Power Point presentation will be saved to my flash drive and downloaded prior to your presentation.

Page 4: Agenda

Link of the weekLink of the weekHTML Tutorialhttp://www.w3schools.com

Purchase CGI scriptshttp://www.cgiscript.net

"How to Create Your Own Home Page" Home Pagehttp://www.intergalact.com/hp/part3/part3.html

CGI Programming FAQ by Nick Kews http://www.webthing.com/tutorials/cgifaq.html

Introduction to CGI Scriptshttp://linux.die.net/man/3/cgi

Page 5: Agenda

Link of the weekLink of the weekWhat does CGI stand for?

Common in the sense that there are many programming languages that scripts can be written in and interact with different types of systems. The user isn’t limited to just one way.

Gateway in strengths that lie in not only what it can do itself, but with it’s potential access it offers to other systems (databases/graphic generators).

Interface that provides a well-defined way to call up its features. The interface between the CGI script and the Web server is fixed.

Page 6: Agenda

Link of the weekLink of the weekCGI Scripts

CGI is the standard for interfacing with external applications and information servers. The information servers can be HTTP or Web servers. The CGI scripts provide a more dynamic avenue for information servers to pursue rather than as a HTML file server.

Page 7: Agenda

Link of the weekLink of the weekCGI Scripts

Page 8: Agenda

Link of the weekLink of the weekWeb Server

The primary function of the web server is to store, process and insure that the web pages are delivered to the client. The communication mechanism between the client and the web server is by the use of the Hypertext Transfer Protocol (HTTP). The most frequently delivered pages are HTML documents, which may include images, scripts, and style sheets in addition to text content.

The user typically initiates the communication by making a request from a web browser or web crawler. Typically, this request is for a specific resource using HTTP and the server responds with that specific resource or an error message detailing why the request cannot be met.

Page 9: Agenda

Link of the weekLink of the weekPROCESS STATE CODES (man ps command)

D uninterruptible sleep (usually IO)R runable (on run queue)S sleepingT traced or stoppedZ a defunct ("zombie") process. Defunct ("zombie") process, terminated but not reaped by it’s parent.

For BSD formats and when the “STAT" keyword is used, additional letters may be displayed:

W has no resident pages< high-priority processN low-priority taskL has pages locked into memory (for real-time and

custom IO)

Page 10: Agenda

Link of the weekLink of the weekPROCESS STATE CODES (man ps command)For BSD formats and when the stat keyword is used,

additional characters may be displayed: < high-priority (not nice to other users) N low-priority (nice to other users) L has pages locked into memory (for real-time and

custom IO) s is a session leader l is multi-threaded (using CLONE_THREAD, like

NPTL threads do) + is in the foreground process group

Page 11: Agenda

Link of the weekLink of the weekPROCESS STATE CODES (man ps

command)

Use the ps -aux | less command to display the above mentioned codes listed under the STAT column heading.

Page 12: Agenda

Link of the weekLink of the weekPROCESS STATE Code/export/home/dandrear> ps –aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDroot 1 0.0 0.0 1424 488 ? S Oct19 0:24 initroot 2 0.0 0.0 0 0 ? SW Oct19 0:00 [migration/0]root 3 0.0 0.0 0 0 ? SW Oct19 0:00 [migration/1]root 4 0.0 0.0 0 0 ? SW Oct19 0:00 [migration/2]root 5 0.0 0.0 0 0 ? SW Oct19 0:00 [migration/3]root 6 0.0 0.0 0 0 ? SW Oct19 0:00 [keventd]root 7 0.0 0.0 0 0 ? SWN Oct19 0:00 [ksoftirqd/0]root 8 0.0 0.0 0 0 ? SWN Oct19 0:00 [ksoftirqd/1]root 9 0.0 0.0 0 0 ? SWN Oct19 0:00 [ksoftirqd/2]root 10 0.0 0.0 0 0 ? SWN Oct19 0:00 [ksoftirqd/3]

VSZ – virtual memory usage of the entire process.RSS – non-swapped physical memory that a task has

used.

Page 13: Agenda

Link of the weekLink of the weekPROCESS STATE Code/export/home/dandrear>ps –aux | less

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND

root 26 0.0 0.0 0 0 ? S 2011 4:19 [kswapd0]root 27 0.0 0.0 0 0 ? SN 2011 0:00 [ksmd]root 28 0.0 0.0 0 0 ? S 2011 0:00 [aio/0]root 401 0.0 0.0 2428 8 ? S<s 2011 0:00 /sbin/udevd -droot 612 0.0 0.0 0 0 ? S 2011 0:00 [vmmemctl]dandrear 20749 0.0 0.0 4812 1036 pts/0 R+ 20:23 0:00 ps -auxdandrear 20750 0.0 0.0 4448 784 pts/0 S+ 20:23 0:00 less

Page 14: Agenda

This Week’s Expected OutcomesThis Week’s Expected OutcomesWhat information are we covering?

Upon successful completion of this module, the student will be able to:Fsck utility

lost+found directoryDescribe the structure and use of Web

servers. Create and run CGI scripts. Evaluate a current Web technology project. Review PATA, SATA, and SCSI disks technologyPurpose of partitions

Page 15: Agenda

UNIX Operating SystemUNIX Operating SystemWhat function does the lost+found directory

provide?Fsck is a utility that checks and repairs files.

Fsck, tries to locate fragments of files that are not referenced anywhere in the filesystem. In particular, fsck might find data that looks like a complete file, but does not have a name anywhere on the system or an inode with a corresponding file name. This data is considered garbage because it is still occupying disk space, and is not accessible by normal means.

When fsck is executed to repair a filesystem, it turns almost deleted files back into files. The file with the missing name and location use to exist in the filesystem, but the information is no longer available.

Page 16: Agenda

UNIX Operating SystemUNIX Operating SystemWhat function does the lost+found directory

provide?During execution, fsck deposits the file in the

lost+found directory. The file was once lost and now it has been found.

Page 17: Agenda

UNIX Operating SystemUNIX Operating SystemWhat function does the lost+found directory

provide? Each Linux file system has a lost+found

directory. If the file system crashes, a file system check will be performed at next boot. Any corrupted files found will be placed in the lost+found directory, so you can attempt to recover as much data as possible.

Usually, there is one directory in every disk partition. Disk errors or incorrect system shutdowns cause files to become lost. This is the directory they usually can be found in.

Page 18: Agenda

UNIX Operating SystemUNIX Operating SystemWhat function does the lost+found directory

provide? Files that appear in lost+found are typically

files that were already unlinked (i.e. their name had been erased) but still opened by some process (so the data wasn't erased yet) when the system halted suddenly (kernel panic or power failure). If that's all that happened, these files were slated for deletion anyway, you don't need to worry about them.

Page 19: Agenda

UNIX Operating SystemUNIX Operating SystemWhat function does the lost+found directory

provide? Files can also appear in the lost+found

directory because the filesystem was in an inconsistent state due to a software or hardware bug. If that's the case, it's a way for you to find files that were lost but that the system repair managed to salvage. The files may or may not contain useful data, and even if they do they may be incomplete or out of date; it all depends how bad the filesystem damage was.

Page 20: Agenda

UNIX Operating SystemUNIX Operating SystemWhat function does the lost+found directory

provide? On many filesystems, the lost+found directory

is a bit special because it pre-allocates a bit of space for fsck to deposit files there. (The space isn't for the file data, which fsck leaves in place; it's for the directory entries which fsck has to make up.) If you accidentally delete lost+found, don't re-create it with mkdir, use mklost+found command if available on your system.

Page 21: Agenda

UNIX Operating SystemUNIX Operating SystemThe MD5 Message-Digest algorithm is a

popular cryptographic hash function that produces a 128 bit hash value, typically represented in a text format as a 32 digit hexadecimal number.

In recent times, a flaw was found in the design of MD5. While the flaw was not considered catastrophic, it was shown that MD5 is not collision resistant. MD5 is not suitable for applications like SSL certificates or digital signatures, which rely on this property of digital security.

Page 22: Agenda

UNIX Operating SystemUNIX Operating SystemOne-Way Encryption (Message Digest 5)

1. MD5 encrypted password (option secret 0)2. MD5 encryption text string (option secret 5)

The optional 0 keyword enables MD5 encryption on a clear text password; the 5 keyword enters an MD5 encryption string and saves it as the user MD5-encrypted secret. MD5 encryption is a strong encryption method which is not retrievable; thus, you cannot use MD5 encryption with protocols that require clear text passwords, such as CHAP

Page 23: Agenda

UNIX Operating SystemUNIX Operating SystemOne-Way Encryption (Message Digest 5)

MD5 encryption is a one way hash encryption algorithm and cannot be decrypted (except by brute force). MD5 encryption can be compromised using brute force on it. Rainbow tables use a mathematic algorithm so its easier and faster than a common brute force.

And yes, there are tables which can crack MD5. If a password is bigger than 15 characters, it takes a hacker more time to create the conditions necessary to compromise the password.

So, if your password is bigger than 15 characters your level of security is considered safe.

Page 24: Agenda

UNIX Operating SystemUNIX Operating System

UNIX Operating System video:https://www.youtube.com/watch?v=xHu7qI1gDPA

Page 25: Agenda

UNIX Operating SystemUNIX Operating SystemSuper Block Attributes

Contains information about each mounted file system.

The super-block is the first block of each ext2FS/ext3FS partition. It contains important data about the file system, such as its size, free space, etc. (it is similar to the method used by FAT partitions). A partition with a damaged super-block cannot be mounted. Fortunately, ext2FS/ext3FS keeps several super-block backup copies scattered over the partition.

Most of the information stored in the super-block is considered static. Static information can be critical in recovering data.

Page 26: Agenda

UNIX Operating SystemUNIX Operating System

Super Block File Manager

ext3 File System

Linux Virtual File SystemKernel

Page 27: Agenda

UNIX Operating SystemUNIX Operating SystemLinux Virtual File System (VFS)

The purpose of a VFS is to allow client applications to access different types of file systems in a uniform way.

Manages kernel file abstractions in one format for all file systems.

Receive system call requests from user level (e.g. write, open, stat, link).

Interacts with a specific file system based on the mount point traversal

Receive requests from other parts of the kernel, mostly from memory management.

Page 28: Agenda

UNIX Operating SystemUNIX Operating SystemFile Manager

The file manager is a program that provides a user interface to work with the file system. They are very useful for speeding up interaction with files. The most common operations on files are create, open, edit, print, rename, move, and copy

Page 29: Agenda

UNIX Operating SystemUNIX Operating SystemLDAP (Lightweight Directory Access

Protocol ):A set of protocols for accessing

information directories. LDAP is considered the simplified version of the X-500 standard. Unlike the X-500 standard, LDAP supports TCP/IP for Internet access.

Page 30: Agenda

UNIX Operating SystemUNIX Operating SystemLDAP Characteristics• Relatively Static Data - the data is rarely modified.

How often do you change your telephone number? • Extremely Fast Read Operations - the directory is

tuned for high read performance because the data in the directory is frequently read and rarely written or updated.

• Distributed - the data is located on a number of systems on the network for redundancy, performance, and scalability.

• Hierarchical -This ensures there is an authoritative source of the data in the directory system.

Page 31: Agenda

UNIX Operating SystemUNIX Operating SystemApache Web Server

Apache Web server is free and distributed as source files by the Apache Software Foundation.

Apache is generally recognized as the world's most popular Web server (HTTP server). Originally designed for UNIX servers, the Apache Web server has been ported to Windows and other network operating systems. The name "Apache" derives from the word "patchy" that the Apache developers used to describe early versions of their software.

apache 31748 27504 0 Mar23 ? 00:00:03 /usr/sbin/httpd

Page 32: Agenda

UNIX Operating SystemUNIX Operating SystemDescribe the structure and use of Web

servers. Early Web sites consisted of HTML pages that could only provide data that was written into the HTML page itself. This was sufficient for that time frame.

Currently, Web sites provide dynamic data into an HTML page with the use of CGI scripts.

It is a mechanism for a Web server to be able to interact with an external program. These external programs are CGI scripts.

Page 33: Agenda

UNIX Operating SystemUNIX Operating SystemDescribe the structure and use of Web

servers. CGI scripts can be written in any programming languages. Perl is the common choice because of its feature richness.

The web is composed of clients and servers. CGI is used on the server to provide additional services and functionality to the client.

Page 34: Agenda

UNIX Operating SystemUNIX Operating SystemThe Apache HTTP server must be instructed to

locate the CGI scripts. Two more pieces of information are needed.

1) A program in that directory to be used as a CGI script.

2) A link in an HTML page to your CGI script.

The CGI script itself simply produces output to stdout. The HTTP server captures that output and sends it to the Web browser. The format of the output must be in a form that the Web browser can understand (HTML).

The CGI script creates the HTML page every time it is run.

The data provided to the HTML page can change with each execution of the script. The Web browser reports data dynamically to the user.

Page 35: Agenda

UNIX Operating SystemUNIX Operating SystemURL that points to the CGI script.

http://cs.franklin.edu/~dandrear/itec400/CGI/sysInfo.cgi

Apache Web ServerA user can test from a Web browser on the same machine using the host name “localhost.” http://localhost will try to find a Web server on the same machine as the Web browser.

Page 36: Agenda

UNIX Operating SystemUNIX Operating SystemHard Disks

Hard disks are among the most important components in your system.

There are three hard disks interfaces on most computers1. Parallel Advanced Technology Attachment (PATA)2. Serial Advanced Technology Attachment (SATA)3. Small Computer System Interface (SCSI).

Page 37: Agenda

UNIX Operating SystemUNIX Operating SystemConfiguring PATA Disks

PATA disks were once the dominate player in the x86 PC world. Since 2005, PATA still exists, but in the shadows of years past. PATA disks are still available.

Page 38: Agenda

UNIX Operating SystemUNIX Operating SystemConfiguring PATA Disks

PATA is a parallel interface, which means that several bits of data are transferred over the cable at one time. PATA cables are thick/wide, because they support 40 to 80 lines, depending on the variety of PATA. The PAPA ribbon cable contains three connectors. One connector connects to the motherboard, and the other two connect to disk devices.

PATA disks are connected as masters or as slaves. This is typically done with jumpers on the physical disks themselves. The master devices are located at the ends of the cable, and the slave device resided on the middle connector.

Page 39: Agenda

UNIX Operating SystemUNIX Operating System

Page 40: Agenda

UNIX Operating SystemUNIX Operating SystemDisk performance

Disks should be connected to separate controllers rather than configured as slave and master on the same single controller, because each PATA controller has a limited throughput that may be exceeded by two drives. Today, most motherboards have at least two controllers, so putting each drive on its own controller is more efficient.

PATA transfer rate is 128-1064 Mbps

Page 41: Agenda

UNIX Operating SystemUNIX Operating SystemSATA disks

SATA disks are newer than PATA disks. The SATA disks connect to the motherboards or controllers on a one-to-one basis. SATA disks do not use jumpers.

SATA is a serial bus, which transfers one bit of data at a time and is faster that PATA data transfers. The size of a SATA cable is much smaller than a PATA cable.

Page 42: Agenda

UNIX Operating SystemUNIX Operating SystemSATA disks

Modern firmware detects the presence of SATA disks just as it did for PATA disks. The firmware may provide boot up options. This could be true if the motherboard does not provide SATA support but you use a separate SATA controller card. It is possible to boot from a SATA disk in such cases if your controller card supports this option or you might have to used the PATA boot disk.

Page 43: Agenda

UNIX Operating SystemUNIX Operating SystemConfiguring SATA Disks

In most cases, Linux SATA drivers treat SATA disks as if they were SCSI. Some older drivers treat SATA disks like PATA disks, so you need to use PATA names on some occasions.

Page 44: Agenda

UNIX Operating SystemUNIX Operating SystemSATA performanceSATA transfer rate 1.5 – 6.0Gbps

Page 45: Agenda

UNIX Operating SystemUNIX Operating SystemConfiguring SCSI disks

SCSI disks are available in a variety of flavors. SCSI cables come in different sizes and operate at different speeds. Traditionally, SCSI has been a parallel bus, like PATA although the latest variant is a serial bus like SATA. Although, SCSI is considered a superior bus compared to PATA, it cost difference has risen dramatically in the past few years, which has affected their sales.

Page 46: Agenda

UNIX Operating SystemUNIX Operating SystemConfiguring SCSI Disks

SCSI supports as many as 8 to 16 devices per bus, depending on the variant release. In practice, the number of devices you can attach to a SCSI bus is more restricted because of cable length limits, which vary from one SCSI variant to another. Each device has it’s own ID number, To set the ID, consult the associated documentation.

Page 47: Agenda

UNIX Operating SystemUNIX Operating SystemConfiguring SCSI Disks

The SCSI bus is logically just one dimension. That means that every device on the bus falls along a single line. The bus is straight for all practical purposes. Each end of the SCSI bus must be terminated. This is performed by including a special resistor pack that prevents signals from bouncing back and forth along the SCSI chain. Termination is a hardware requirement, it doesn’t apply to SATA or USB disk devices, even though they use Linux SCSI drivers.

Page 48: Agenda

UNIX Operating SystemUNIX Operating SystemWhy Partition Your Disk?•Multiple OS Support – keep different OSs separate.•File system Choice – use different file system. Different file system speeds might be a factor.•Disk Space Management –allows a user to save certain sets of files into a fixed space. It restricts users to storing in one or two partitions, without causing problems in other partitions.

Page 49: Agenda

UNIX Operating SystemUNIX Operating SystemWhy Partition Your Disk?•Disk Error Protection - file systems do experience errors.•Security – a partition that contains critical information can be mounted read-only. This provides an additional layer of security above the normal file and directory permissions.

Page 50: Agenda

UNIX Operating SystemUNIX Operating SystemWhy Partition Your Disk?•Backup – many Linux systems backup utilities work better on whole disks. Keeping partitions small is more advantageous for backing up, than you could with large partitions.

Page 51: Agenda

UNIX Operating SystemUNIX Operating SystemPartitioning a Disk

Traditionally, Linux used the fdisk utility for disk partitioning. The full definition of the utility name is fixed disk, which is the same name used by DOS and Windows to basically accomplish the same task.

Page 52: Agenda

UNIX Operating SystemUNIX Operating SystemUnderstanding Partitioning Systems

Partitions are predefined by data structures that are written to specific areas of the hard disk. Today, there are several competing systems to re-define partition use. On the x86 and x86-64 hardware, up to 2010 had been the Master Boot Record (MBR) partitioning system, where the data in the first sector of the disk is known as the MBR. This configuration is limited to partitions and partition placement of 2 tebibytes (TiB; is 2 40th bytes), when using sector size of 512 bytes.

Page 53: Agenda

UNIX Operating SystemUNIX Operating SystemUnderstanding Partitioning Systems

The original x86 hardware partitioning scheme allowed for four partitions. As hard disks increased in size, it became apparent that more partitions were needed, so the original scheme was extended in such a way to retain backward compatibility.

One of the main limitations with using the original MBR method is the usage of 32 bits for storing logical block addresses and size information.

Page 54: Agenda

UNIX Operating SystemUNIX Operating SystemMBR New Scheme

Page 55: Agenda

UNIX Operating SystemUNIX Operating SystemUnderstanding Partitioning Systems

The new scheme utilizes three partition types;• Primary partitions, which are the same as the

original partition types.• Extended partitions, which are a special type

of primary partition that servers as a placeholder for the logical partitions

• Logical partitions, which resides within an extended partition

Page 56: Agenda

UNIX Operating SystemUNIX Operating SystemUnderstanding Partitioning Systems

One successor to the MBR method is the GUID (Globally Unique Identifiers) Partition Table (GPT) partitioning system, which offers higher limits and certain other advantages. GPT is the preferred partitioning system for disks larger than 2TiB.

As of 2010, most operating systems support GPT. GPT allocates 64 bits for logical block addresses and allows a maximum size of 2 64th -1 sectors. GPT does not use the layout of primary, extended, and logical distinction of MBR.

Page 57: Agenda

UNIX Operating SystemUNIX Operating System

Page 58: Agenda

UNIX Operating SystemUNIX Operating SystemRole of the mount point

Once the disk partitions have been created, the operating system must have some way to access the data in the partition. In Windows systems this is done by assigning a drive letter ( C: or D:). Linux does not use a drive letter, but instead uses a unified directory tree. Each partition is mounted at a mount point in that tree. A mount point is a directory that is used as a way to access the filesystem on the partition, and mounting the filesystem is the process of linking the filesystem to the mount point.

Page 59: Agenda

UNIX Operating SystemUNIX Operating SystemRole of the mount pointLinux system has the following configuration:Three partitions: (/), (/home), and (/usr)

partitionsThe root partition holds the basic system

files, and all other partitions are accessed via directories on that filesystem. If /home contains user’s home directories, such as Bill and Jane, those directories will be accessed as /home/Bill and /home/Jane, once this partition is mounted at /home.

Page 60: Agenda

UNIX Operating SystemUNIX Operating SystemAre All Partitions Alike?No

Some partitions do not hold files. Linux uses a swap partition, as an extension of memory. Linux can also use a swap file, which is a file that works similar to the swap partition. Both are examples of swap space. Linux uses the /etc/fstab file to define which partitions to use as swap space and other filesystem.

Page 61: Agenda

UNIX Operating SystemUNIX Operating System

Points of interest

dos2unix is a function that converts DOS/MAC plain text files into UNIX format.Coldplug devices are designed to be physically connected and disconnected only when the computer is turned off.

Page 62: Agenda

Moving Around in UNIXMoving Around in UNIXtop (Ctrl z) jobsmvmoressh -vLogin to remote host:ssh -l jsmith remotehost.example.comCheck the status of a service:service ssh status

Page 63: Agenda

Break-out problemsBreak-out problemsWhat is the function of the file manager? What is an Apache Web Server?What type of files are found in the lost+found

directory?The super block is found in the first block of the

partition.LDAP characteristicsPATA disksSATA disksSCSI disksMBR and GPTMount point

Page 64: Agenda

Hands on informationHands on information

Lab Assignment 13-1due December 8 and December 15, 2015Lab Assignment 14-1 due December 19, 2015

Page 65: Agenda

After class assistanceAfter class assistance

QuestionsCommentsConcerns

I am available after this Franklin Live session to discuss any problems and/or concerns regarding the lab assignments

Page 66: Agenda

Lab Assistance available by phone Lab Assistance available by phone and/or emailand/or email