Week Eleven Agenda

76

description

Week Eleven Agenda. Announcements Sign up for the open source assignment Open Source Presentation dates December 9 and 16, 2013. Lab Assignment 11-1 Knoppix File System No script logic for the Knoppix File Systeassignment Link of the week Review week ten lab assignment - PowerPoint PPT Presentation

Transcript of Week Eleven Agenda

Page 1: Week Eleven Agenda
Page 2: Week Eleven Agenda

Week Eleven Agenda• Announcements

Sign up for the open source assignmentOpen Source Presentation datesDecember 9 and 16, 2013.Lab Assignment 11-1 Knoppix File

System No script logic for the Knoppix File Syste assignment • Link of the week• Review week ten lab assignment• Week ten expected outcomes• Next lab assignment• Break-out problems• Upcoming deadlines• Lab assistance

Page 3: Week Eleven Agenda

Link of the weekFile System 

Search for the web site written by M. Tim Jones ([email protected])

Anatomy of the Linux file system

The syntax used at this web site will be useful when completing Lab Assignment 11-1. These are “under the hood” commands used by Graphical User Interfaces (GUI).

Page 4: Week Eleven Agenda

Link of the weekWhat is a UNIX-like File system?

A UNIX file system is a collection of files and directories stored on hard disk.  Each file system is stored in a separate whole disk partition. The following are some file systems:

/ - root file system contains files under several directories including /sbin, /tmp, /var, and /dev

What makes up a file system?

User data - information contained in files

Metadata – information on the file system structure such as inodes, directories, and superblock

Page 5: Week Eleven Agenda

Link of the weekIn general, every directory under the root directory is on

the root partition, unless it has a separate entry in the full listing from df (or df -h with no other options).

Every partition has its own file system. By imagining all those file systems together, we can form an idea of the tree-structure for the entire system. In a file system, a file is represented by an inode, a kind of serial number containing information about the actual data that makes up the file: to whom this file belongs, and where is it located on the hard disk.

Page 6: Week Eleven Agenda

Link of the weekEvery partition has its own set of inodes; throughout a

system with multiple partitions, files with the same inode number can exist.

Why partition?

One of the goals of having different partitions is to achieve higher data security in case of disaster. By dividing the hard disk in partitions, data can be grouped and separated. When an accident occurs, only the data in the partition that took the hit will be affected, and the data on the other partitions will remain intact.

Page 7: Week Eleven Agenda

Link of the weekLinux File system ext3 includes journaling

capabilities that allows for faster recovery after unexpected reboots.

Journaling reduces the amount of time spent recovering a file system after a crash, and is therefore in high demand in environments where high availability is important, not only to improve recovery times on single machines but also to allow a crashed machine's file system to be recovered on another machine when we have a cluster of nodes with a shared disk.

Page 8: Week Eleven Agenda

Link of the weekDefine file system with journaling

A file system with journaling is based on the techniques used from real-time transaction processing. A transaction log is used to store transactions either in a designated file system location or on a separate disk partition.

As changes are made to the file system, metadata changes are recorded in the log and writing entries in the log are done prior to writing the actual buffers to disk.

Page 9: Week Eleven Agenda

Link of the week

Linux file system with journaling

In the event of a system crash, the entries in the log file remain intact and are replayed. Maintaining this level of data integrity ensures that the file system is in a constant state.

Page 10: Week Eleven Agenda

Review week ten lab assignment/etc/password file

Location: /etc/passwdField separators: Colon (:) File format:Username:Password:UID:GID:UserID:Home directory:Command/shell

Example:dandrear:x:1020:1021:dandrear user:/home/dandrear:/bin/ksh

Permissions on Einstein:-rw-r--r-- 1 root root 1636 Aug 16 10:37 /etc/passwd

Page 11: Week Eleven Agenda

Review week ten lab assignment/etc/passwd file Username: It is used when user logs in. It should be between 1 and 32

characters in length. Password: An x character indicates that encrypted password is stored in

/etc/shadow file. User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero)

is reserved for root and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by system for administrative and system accounts/groups.

Group ID (GID): The primary group ID (stored in /etc/group file) User ID Info: The comment field. It allow you to add extra information

about the users such as user’s full name, phone number etc. This field use by finger command.

Home directory: The absolute path to the directory the user will be in when they log in. If this directory does not exists then users directory becomes /

Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this is a shell. Please not it does not have to be a shell.

Page 12: Week Eleven Agenda

Review week ten lab assignmentExample of /etc/passwd file

root:x:0:0:root:/root:/bin/bash

bin:x:1:1:bin:/bin:/sbin/nologin

daemon:x:2:2:daemon:/sbin:/sbin/nologin

adm:x:3:4:adm:/var/adm:/sbin/nologin

lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin

sync:x:5:0:sync:/sbin:/bin/sync

shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown

halt:x:7:0:halt:/sbin:/sbin/halt

Page 13: Week Eleven Agenda

Review week ten lab assignment/etc/passwd file

The /etc/passwd file is considered the user database for the system.

The information contained in the /etc/passwd file is useful for applications running on the system to access.

In summary, the /etc/passwd file is located under the system configuration and executables directory. The /etc/passwd file is the system’s master list of information about user accounts.

Page 14: Week Eleven Agenda

Review week ten lab assignment

/etc/shadow file

Location: /etc/shadow

Field separators: Colon (:)

File format:

username:passwd:lastpasswdch:min:max:warn:inactive:expire:unused

Example:

dandrear:$1$dhBysgdhfteM9gd00:13064:0:99999:7:::

Permissions on Einstein:

-r-------- 1 root root 1107 Sep 5 15:24 /etc/shadow (Permission denied)

Page 15: Week Eleven Agenda

Review week ten lab assignment/etc/shadow file User name : It is your login name Password: It your encrypted password. The password should be minimum

6-8 characters long including special characters/digits Last password change (last changed): Days since Jan 1, 1970 that

password was last changed Minimum: The minimum number of days required between password

changes i.e. the number of days left before the user is allowed to change his/her password

Maximum: The maximum number of days the password is valid (after that user is forced to change his/her password)

Warn : The number of days before password is to expire that user is warned that his/her password must be changed

Inactive : The number of days after password expires that account is disabled

Expire : days since Jan 1, 1970 that account is disabled i.e. an absolute date specifying when the login may no longer be used

Unused field:

Page 16: Week Eleven Agenda

Review week ten lab assignment/etc/shadow file• The “X” in the /etc/passwd file password field indicates that

the shadow file contains the encrypted password.• Red Hat Linux uses MD5 by default.• Most Linux systems utilize MD5 as their encrypted form.• MD5 requires 34 characters in encryption form.• MD5 begins with a dollar sign, number, and a dollar sign

(e.g. $1$ or $6$ …).• The shadow file is only readable by root.

In summary, the /etc/shadow file contains the encoded passwords and password settings. The /etc/shadow file contains all the guide lines that pertain to the administration of the password.

Page 17: Week Eleven Agenda

Review week ten lab assignment/etc/group file

Location: /etc/groupField separators: Colon (:) File format:Group name:Password:GID:User_list

Example:faculty:x:410:staff:x:430:

Permissions on Einstein:-rw-r--r-- 1 root root 833 Aug 16 10:37 group

Page 18: Week Eleven Agenda

Review week ten lab assignment/etc/group file Group name: Name of the group. Password: The group password is encrypted. If this

field is empty, no password is needed. Otherwise, an “X” in the field indicates the password is stored in the /etc/gshadow file.

GID: The numerical group ID and/or unique group identifier.

User_list: All the group member's user names, separated by commas.

Most Unix-like systems impose a limit of 16 to 32 group memberships per user.

Page 19: Week Eleven Agenda

Review week ten lab assignment/etc/group file

ntp:x:38: student:x:101:

itadmin:x:400:faculty:x:410:

csfac:x:420:mccannp,sieberth,hochstew,whittakt,morganr,hartungstaff:x:430:hpsmh:x:501:kumarp:x:503:caldwelr:x:505:apache:x:48:oinstall:x:600:

Linux utilizes the vigr command used to edit the /etc/group file.

Page 20: Week Eleven Agenda

Review week ten lab assignment/etc/group file

In summary, the /etc/group file identifies a collection of users who generally share similar functions. These groupings are not limited to departments or project.

Page 21: Week Eleven Agenda

Review week ten lab assignment/etc/gshadow file Group-name: is the name of the group Password: is the encoded version of the

password Group-admins: is the list of members in the

group Additional- users: a copy of additional

members.

In summary, the /etc/gshadow file is utilized to store the /etc/group password.

Page 22: Week Eleven Agenda

Review week ten lab assignmentFile Summary

/etc/passwd - user account information /etc/shadow - secure user password information

/etc/group - group information /etc/gshadow - secure group password informationUser account files The /etc/passwd, /etc/shadow, and /etc/group files are

considered the most important files for storing user account and authentication information.

Command to add a user account

Linux/Knoppix –useradd/deluserCommand to remove a user account

Knoppix – deluserLinux - userdel

Page 23: Week Eleven Agenda

Review week ten lab assignment

Managing UsersAdding a user to a computer involves several steps before the user can actually log in and perform user operations.

Every user that intends to utilize a computer must first gain access to that system, then go through an initialization process found under the user’s home directory. The new user initialization process begins by reading and executing the commands and environmental variables found in the $HOME/.profile file or .bash_profile. Normally, the .profile is run automatically when you log into the system and the user’s environment is set up silently. Once the user is granted permission to access the system, a shell is spawn to allow the user to interact with the system.

Page 24: Week Eleven Agenda

Review week ten lab assignment

Managing Users

Display the ~dandrear/.profile

When adding a new user account to the system, the administrator assigns the username a user identification number (UID). The UID is used internally by the system to identify each user. Duplicating the UID causes the accounts to share an identity in the system.

Page 25: Week Eleven Agenda

Review week ten lab assignmentProcesses

The & symbol represents the background process.Once a background process is launched by a terminal session, the process becomes unattached to the terminal that launched it. Background processes are terminated typing kill -9 <pid>

Example: simple_script &

Once a foreground process is started, it remains in the foreground until it completes, because it remains attached to the terminal. Foreground process by typing Ctl-C

Page 26: Week Eleven Agenda

Review week ten lab assignmentKernel functions in two ways

A responsive function is one where resource allocation and process creation and management, are initiated by requests from processes.

An autonomous function is the allocation of memory and CPU, which are performed without explicitly requested by a user process.

Daemon processes are started as part of the boot process and run until the system is shut down. Daemon processes can be associated with a systems database applications, network , secure terminal and file transfer, and scheduling tasks

Page 27: Week Eleven Agenda

Review week ten lab assignmentUNIX inetd Daemon

The UNIX inetd daemon may start the telnetd to handle a telnet connection. Inetd daemon may start the ftpd to handle an ftp connection.One daemon may start another; the UNIX inetd daemon will accept a network connection and then start another daemon to handle the connection, based on the type of connection. There are various processes in UNIX that are not owned by a user, but exist to provide services. These processes are often called "daemons.“

The inetd superserver runs continuously listening for network connections. This type of daemon is more susceptible to be system breaches.

Page 28: Week Eleven Agenda

Review week ten lab assignmentLinux xinetd daemon

The Linus xinetd daemon is a more secure replacement for the inetd superserver. The xinetd superserver listens for network connections. When a connection is made, it launches a specific daemon and forwards the data from the socket to the daemon’s standard input. Basically, the xinetd superserver works on-demand.

Page 29: Week Eleven Agenda

Review week ten lab assignmentLinux xinetd daemon

The xinetd daemon has TCP Wrappers capabilities built-in.

TCP Wrapper is a security tool available on most flavors of UNIX, AIX, HP-UX, Linux and Solaris operating systems. TCP Wrapper is a lightweight alternative to a firewall. Excellent tool for reducing CPU usage. Real firewalls generally are CPU intensive.

TCP Wrapper is not widely known by system administrators.

Page 30: Week Eleven Agenda

Review week ten lab assignmentSingle and Multi-Threaded Processes

The implementation of a thread may differ from one operating system to another. Generally, a thread exists within a process. Multiple threads within a single process can co-exist and share the same resources.

Page 31: Week Eleven Agenda

Review week ten lab assignmentThreads compared to Processes

Threads exist as subsets of a process.

Multiple threads in a single process share memory and other resources.

Threads share the same address space.

Threads utilize context switching the same as a process.

Page 32: Week Eleven Agenda

Review week ten lab assignmentSingle and Multi-Threaded Processes

Single threaded process is when a process only performs one task. An embedded system is an example of a single threaded process (BIOS).

Multiple threaded process is when a process can perform multiple tasks concurrently without extra overhead needed to create a new process. Word processor is a multiple threaded process.

Page 33: Week Eleven Agenda

Review week ten lab assignmentKernel Functions

The kernel is part of the operating system that allocates machine resources, including memory, disk space, and CPU cycles to all other programs that run on a computer. The kernel can be responsible for creating the init process. The init process is created through a process called hand-crafted or spontaneous.

Page 34: Week Eleven Agenda

Review week ten lab assignmentfork command

Is a command that causes the shell to fork a new process, creating a duplicate of the shell process (sub-shell).

exec command

The new process attempts to exec the command. If the command is a binary executable program, like a compiled C program, exec succeeds and the system overlays the newly created sub-shell with the executable program.

The fork and exec commands are system calls that are executed by the operating system.

Page 35: Week Eleven Agenda

Review week ten lab assignmentLinux Process StatesProcesses go through various process states during their

existence. These are transitory states managed by the operating system (OS). The specifics of these process states vary from one OS to another, as well as state names.

Waiting (process scheduler - load from secondary storage to main memory)

Executing (after a process is assigned a processor by a short – term scheduler, context switch is performed)

Stopped (The process has been stopped, usually by receiving a signal. A process that is being debugged can be in a stopped state or another task is executing )

Zombie (This is a halted process for some reason. Still has an entry in the task_struct data structure)

Page 36: Week Eleven Agenda

Review week ten lab assignment

Page 37: Week Eleven Agenda

Review week ten lab assignment

Page 38: Week Eleven Agenda

Review week ten lab assignmentA zombie process is one that has completed

execution but still has an entry in the process table, allowing the process that started it to read its exit status. Remember that a zombie is already dead.

Processes marked <defunct> are dead processes (so-called "zombies")

Locate a zombie process on cs.franklin.edu

Commands:

ps -aux

Page 39: Week Eleven Agenda

Review week ten lab assignmentOrphan process is a process whose parent

process has terminated or finished.

Characteristics of an orphan process:

The owner of an orphan process can kill that process. Logging off your terminal will not guarantee termination of your orphan.

An orphan process may continue to execute, taking up system resources and slowing the machine down for other users.

If you notice slow performance on a machine and you see an orphan process that doesn’t belong to you.

Page 40: Week Eleven Agenda

Review week ten lab assignment

Is there an orphan process listed below?

root 1 0 0 2010 ? 00:03:17 initdandrear 22387 22385 0 17:34 pts/1 00:00:00 grep initroot 927 1 0 2010 ? 00:08:58 /usr/sbin/sshdroot 22350 927 0 17:31 ? 00:00:00 sshd:

dandrear@pts/1dandrear 22390 22385 0 17:34 pts/1 00:00:00 sort -rdandrear 22389 22385 0 17:34 pts/1 00:00:00 grep dandreardandrear 22388 22385 0 17:34 pts/1 00:00:00 ps -efdandrear 22385 22351 0 17:34 pts/1 00:00:00 /bin/ksh

./pid_ppid.sh dandreardandrear 22351 22350 0 17:31 pts/1 00:00:00 -ksh

Page 41: Week Eleven Agenda

Review week ten lab assignmentIs there an orphan process listed below?

root 1 0 0 2010 ? 00:03:17 init

dandrear 22387 22385 0 17:34 pts/1 00:00:00 grep init

root 927 1 0 2010 ? 00:08:58 /usr/sbin/sshd

root 22350 927 0 17:31 ? 00:00:00 sshd: dandrear@pts/1

dandrear 22390 22385 0 17:34 pts/1 00:00:00 sort -r

dandrear 22389 22385 0 17:34 pts/1 00:00:00 grep dandrear

dandrear 22388 26386 0 23:34 pts/1 00:00:00 ps -ef

dandrear 22385 22351 0 17:34 pts/1 00:00:00 /bin/ksh ./pid_ppid.sh dandrear

dandrear 22351 22350 0 17:31 pts/1 00:00:00 -ksh

Page 42: Week Eleven Agenda

Review week ten lab assignmentTerminate orphan Processes

kill -3 8074

Signal the process with 8074 pid to “quit”

 

kill -1 8074

Signal the process with 8074 pid to “hangup”

 

kill -9 8074

Signal the process with pid 8074 to be “killed”

Page 43: Week Eleven Agenda

Review week ten lab assignment/etc/rc.d/rc.sysinit

This init script performs basic system configuration which includes setting the system clock, hostname, and keyboard mapping; setting up the swap partitions; checking the remaining file system for errors; and turning on the quota management.

/etc/rc.d/rc

This init script runs the scripts for the services that need to be started when you first bring the system up and that need to be started or stopped when the system goes from single user mode to multiuser mode and back down again.

Page 44: Week Eleven Agenda

Review week ten lab assignment

/etc/rc.d/init.d

This init.d directory contains shell rc scripts and run via symbolic links in the /etc/rc.d/rcn.d directories, where n is the runlevel the system is entering.

/etc/rc.d/rc.local

This file is executed after the init scripts. Commands can be placed in this file to customize the system. These commands are best suited to execute in the background and after the initialization process completes.

Page 45: Week Eleven Agenda

Review week ten lab assignment/etc/rc.d/rc1.d

This directory contains scripts that start and stop during a specific run level. The following scripts execute during run level one (1):K10cups K25sshd K50netdump K74nscd K86nfslock K91isdn S01sysstat

Notice the numbering from 00 to 99. This numbering provides positioning of a script within the whole scheme of execution.

Page 46: Week Eleven Agenda

Review week ten lab assignment/etc/rc.d/rc1.d

K01cmanic -> /etc/init.d/cmanic

K01hprsm -> /etc/init.d/hprsm

K03rhnsd -> ../init.d/rhnsd

K05atd -> ../init.d/atd

K05saslauthd -> ../init.d/saslauthd

K10cups K10hpasm -> /etc/init.d/hpasm

K10psacct -> ../init.d/psacct

K15gpm -> ../init.d/gpm-> ../init.d/cups

Page 47: Week Eleven Agenda

Review week ten lab assignment

Security Tools

SELinux manage the kernel’s functionality

iptables is a packet filter. It monitors network packets, and protocol types.

chroot jail creates a temporary root file system

Page 48: Week Eleven Agenda

Review week ten lab assignment

Security Tools

Linux xinetd daemon

The xinetd daemon has TCP Wrappers capabilities built-in.

TCP Wrapper is a security tool available on most flavors of UNIX, AIX, HP-UX, Linux and Solaris operating systems. TCP Wrapper is a lightweight alternative to a firewall. Excellent tool for reducing CPU usage. Real firewalls generally are CPU intensive.

TCP Wrapper is not widely known by system administrators.

iptables is a packet filter. It monitors network packets, and protocol types.

chroot jail creates a temporary root file system

Page 49: Week Eleven Agenda

Review week ten lab assignment

Security Tools

TCP Wrapper part of a client/server model. This access control language defines rules that selectively allow clients to access server daemons on a local system based on the client’s address and the daemon the client tries to access.

Page 50: Week Eleven Agenda

Review week ten lab assignment

/etc/inittab format (id:runlevel:action:process)

id is a unique sequence of 1-4 characters which identify an entry in /etc/inittab

runlevel is a specific process level that action should be taken

action describes which action should be performed

process specifies which process to be executed.

Page 51: Week Eleven Agenda

Review week ten lab assignment

/etc/inittab

# inittab is only used by upstart for the default runlevel.

#

# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.

#

# System initialization is started by /etc/init/rcS.conf

#

# Individual runlevels are started by /etc/init/rc.conf

Page 52: Week Eleven Agenda

Review week ten lab assignment/etc/inittab

#

# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf

#

# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,

# with configuration in /etc/sysconfig/init.

#

# For information on how to write upstart event handlers, or how

# upstart works, see init(5), init(8), and initctl(8).

Page 53: Week Eleven Agenda

Review week ten lab assignment/etc/inittab

# Default runlevel. The runlevels used are:

# 0 - halt (Do NOT set initdefault to this)

# 1 - Single user mode

# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)

# 3 - Full multiuser mode

# 4 - unused

# 5 - X11

# 6 - reboot (Do NOT set initdefault to this)

#

id:3:initdefault:

Page 54: Week Eleven Agenda

Week ten, eleven, & twelve expected outcomesUpon successful completion of this module, the student will be

able to:

• Manipulate user accounts. • Describe how cron is used to invoke repetitive processes. • Manipulate process structure including:

a) fork and execute b) Initialization processc) Background/foreground d) PS tool

• Explain basic UNIX security issues. • Describe disk and file system structure. • Use backup and restore archival operations on a system. • Establish network services. • Investigate the structure of the LDAP directory using LDAP

commands.

Page 55: Week Eleven Agenda

Next Lab AssignmentNFS (Network File System)

In UNIX, the file system isn’t visible to the user. The user doesn’t know or have a need to keep track of the physical location of file(s) like other file systems require. The root directory, denoted by a forward slash (/) is the central component of the file system. Other directories can be attached (mounted) to the root directory and utilized.

Page 56: Week Eleven Agenda

Next Lab AssignmentNFS (Network File System)

NFS is a file and directory sharing mechanism native to Unix, HP-UX, and Linux. NFS is simple to set up. On the server, you make an entry in the /etc/exports file to enable its use by the client. This is called sharing.

Page 57: Week Eleven Agenda

Next Lab AssignmentNFS (Network File System)

In order to access host file systems or printers using an NFS client, the file systems must be exported. To export a file system or printer, it must be added to the host /etc/exports file.

The exports file allows the administrator to control the following access:

Which file systems are made available to remote users

Which remote users can access each file system

What access limitations the remote users have to each exported file system

Page 58: Week Eleven Agenda

Next Lab AssignmentNFS (Network File System)

The /etc/exports file contains an entry for each directory that can be exported to NFS clients. This file is read automatically by the exportfs command. If you change this file, you must run the exportfs command before the changes can affect the way the daemon operates.

Only when this file is present during system startup does the rc.nfs script execute the exportfs command and start the nfsd and mountd daemons

Page 59: Week Eleven Agenda

Next Lab AssignmentNFS (Network File System)

On the server, enter the following information to allow sharing:

/dir/to/export host1.mydomain.com(ro,root_squash)

/dir/to/export host2.mydomain.com(ro,root_squash)

/dir/to/export is the directory you want to export

host#.mydomain.com is the machine allowed to log in this directory

The ro option mean mounting read-only

The root_squash option for not allowing root write access in this directory

Page 60: Week Eleven Agenda

Next Lab AssignmentNFS (Network File System)

Many supposed NFS problems are really problems with the firewall. In order for your NFS server to successfully serve NFS shares, its firewall must enable the following:

ICMP Type 3 packets

Port 111, the Portmap daemon

Port 2049, NFS

The port(s) assigned to the mountd daemon

Page 61: Week Eleven Agenda

Next Lab AssignmentSamba

Samba is the standard Windows interoperability suite of programs for Linux and Unix.

The name Samba was derived from SMB (Server Message Block), the protocol that is native method of file and printer sharing for Windows.

  As a server, Samba shares Linux files and printers with Windows systems. As a client, Samba allows Linux users access to files on Windows systems. Samba has the capability to share files across heterogeneous computing environments.

 

Page 62: Week Eleven Agenda

Next Lab AssignmentSamba

For eighteen years, Samba has provided secure, stable and fast file and print services for all clients using the SMB/CIFS protocol, such as all versions of DOS and Windows, OS/2, Linux and many others.

Page 63: Week Eleven Agenda

Next Lab AssignmentSamba

The Samba server uses UDP ports 137 and 138 and TCP ports 139 and 445. Normally, openings in the firewall are needed during installation.

 

Samba users must have the same username as a Linux username or must map to a Linux username. The username(s) that map a Linux username are located in /etc/samba/smbusers file. The record format is

linux_user_name = smb_user_name  

Page 64: Week Eleven Agenda

Next Lab AssignmentWindows uses its own passwords to enter Samba, not Linux passwords. These passwords are located in the /etc/samba/smbpasswd file. Initially, when Samba is installed, this file does not exist on the system. Each technique described, allows the system administrator to add users to smbusers and passwords to smbpasswd. To map a password from a Windows system to a Linux system, use the command

smbpasswd –a smb_passwwd

Page 65: Week Eleven Agenda

Next Lab AssignmentJumpStart Samba

To configure a Samba server, the system-config-samba utility best serves this basic need. This tool is the best one to use if you’re not familiar with Samba. The system-config-samba utility performs three basic functions: configuring the server, configuring users, and setting up shares that are exported to the Windows system.

 

What is a share? It is a filesystem hierarchy that is shared with another system using SMB. It is a directory hierarchy that is exported from a Linux system to a Windows system.

Page 66: Week Eleven Agenda

Next Lab AssignmentThe /etc/samba/smb.conf file controls a large portion of

how Samba works. The smb-config file is divided into sections to specifically address certain sections. They are as follows:

[globals] Defines global parameters

[printers] Defines printers

[homes] Defines shares in the “homes” directory. This share allows each user’s home directory to be shared with specific parameters.

[share name] Defines a share

 

Comments: # or ;

Execute testparm to check whether the smb.conf file is syntactically correct.

Page 67: Week Eleven Agenda

Next Lab Assignment HTML (Hyper Text Markup Language) is a language used to create documents and the World Wide Web.

HTML defines the structure and layout of a Web document by using a variety of tags and attributes.

The correct structure for an HTML document starts with <HTML><HEAD>(enter here what document is about)<BODY> and ends with </BODY></HTML>. All the information you'd like to include in your Web page fits in between the <BODY> and </BODY> tags. Define: Common Gateway Interface (CGI)It is a standard used for interfacing between applications with information servers (Web server). Application: CGI scripts execute in real-time and their output is dynamic in content.Scripts are designed to be executed from a Web daemon that will transmit information to another software facilitator (database engine), and receive the results back again and display them to the client.

Page 68: Week Eleven Agenda

Next lab assignment/etc/init.d/rc.d/crond is started automatically when

entering multi-user runlevel. Crond is a daemon that executes scheduled commands.

/etc/crontab file is a file which contains the schedule of entries to be run and at specified times.

# Einstein /etc/crontab entries01 * * * * root run-parts /etc/cron.hourly02 4 * * * root run-parts /etc/cron.daily22 4 * * 0 root run-parts /etc/cron.weekly42 4 1 * * root run-parts /etc/cron.monthly

Page 69: Week Eleven Agenda

Next lab assignmentcrontab format

* * * * * command to be executed

1 2 3 4 5

First *: min (0-59)

Second *: hour (0-23)

Third *: day of month (1-31)

Fourth *: month (1-12)

Fifth *: day of week (0-6) (Sunday=0)

Example: 40 18 * * * rm /export/home/someuser/*

Page 70: Week Eleven Agenda

Next lab assignment/etc/cron.allow

/etc/cron.deny

crontab commands

crontab -e Edit crontab file

crontab –l Display your crontab file

crontab –r Remove your crontab file

crontab –v Display last time crontab was edited.

Page 71: Week Eleven Agenda

Next lab assignmentFull Backup

Full backup is the starting point for all other types of backup and contains all the data in the folders and files that are selected to be backed up. Because full backup stores all files and folders, frequent full backups result in faster and simpler restore operations. Remember that when you choose other backup types, restore jobs may take longer.

Page 72: Week Eleven Agenda

Next lab assignmentDifferential backup

Differential backup contains all files that have changed since the last FULL backup. The advantage of a differential backup is that it shortens restore time compared to a full backup or an incremental backup. However, if you perform the differential backup too many times, the size of the differential backup might grow to be larger than the baseline full backup.

Page 73: Week Eleven Agenda

Next lab assignmentIncremental backup

Incremental backup stores all files that have changed since the last full, differential or incremental backup. The advantage of an incremental backup is that it takes the least time to complete. However, during a restore operation, each incremental backup must be processed, which could result in a lengthy restore job.

Demonstrate: mail sent from crontab

Page 74: Week Eleven Agenda

Break-out problems1) What is the function of the /etc/fstab file?2) What functionality does Samba provide?3) List the different process states used on a Linux system.4) Explain the relationship between the /etc/passwd file and the

/etc/shadow file.5) What functionality does journaling provide a file system?6) Describe how a background process works with respect to the terminal.7) Describe how a foreground process works with respect to the terminal.8) Syntax used in the /etc/inittab file

respawnwaitctrlaltdelpowerwaitinitdefault

9) Unix commands:uptime uname –n uname –auname –r

Page 75: Week Eleven Agenda

Upcoming deadlinesLab Assignment 10-1, Account Script /LDAP paper due

November 24, 2013.

Lab Assignment 10-2, Process Exercise due November 24, 2013.

Lab Assignment 11-1, Knoppix File System Exercise due December 1, 2013

Final exam will be available on December 16 through 18, 2013.

Lab Assignment 12-1, Programming Assignment 2 due December 8, 2013

Module 6, contains study information for weeks 10, 11, and 12.

Page 76: Week Eleven Agenda

Lab assistance• Questions• Comments• Concerns

• I will be available after this Franklin Live session to discuss any problems and/or concerns regarding lab assignments.