ITI-481: Unix Administration Meeting 5 Christopher Uriarte Rutgers University Center for Applied Computing Technologies.

Slides:



Advertisements
Similar presentations
Linux+ Guide to Linux Certification, Second Edition Chapter 14 Network Configuration.
Advertisements

CPSC 441: FTP & SMTP1 Application Layer: FTP & Instructor: Carey Williamson Office: ICT Class.
WeeSan Lee
Exchange server Mail system Four components Mail user agent (MUA) to read and compose mail Mail transport agent (MTA) route messages Delivery agent.
Chapter 2: Application layer  2.1 Web and HTTP  2.2 FTP 2-1 Lecture 5 Application Layer.
Chapter 2: Application layer  2.1 Web, HTTP and HTML (We will continue…)  2.2 FTP  2.3 SMTP 9/22/2009 Lecture 7, MAT 279, Fall
Chapter 30 Electronic Mail Representation & Transfer
Esimerkki: Sähköposti. Lappeenranta University of Technology / JP, PH, AH Electronic Mail Three major components: user agents mail servers simple mail.
POP Configuration Microsoft Outlook Express 6.x.
2440: 141 Web Site Administration Services Instructor: Enoch E. Damson.
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
-I CS-3505 Wb_ -I.ppt. 4 The most useful feature of the internet 4 Lots of different programs, but most of them can talk to each.
POP Configuration Microsoft Outlook What is POP? Short for Post Office Protocol, a protocol used to retrieve from a mail server. Most.
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
1.  The Linux system of permissions is much more difficult than that of Windows  System administrators are given more control with the use of three.
2: Application Layer1 Chapter 2 Application Layer These slides derived from Computer Networking: A Top Down Approach, 6 th edition. Jim Kurose, Keith Ross.
1 Linux Networking and Security Chapter 3. 2 Configuring Client Services Configure DNS name resolution Configure dial-up network access using PPP Understand.
Electronic Mail (SMTP, POP, IMAP, MIME)
1 Web Server Administration Chapter 8 Providing Services.
SMTP, POP3, IMAP.
1 Application Layer Lecture 5 Imran Ahmed University of Management & Technology.
Mail Server Three major components MTA MUA MDA Mail Transfer Agent
Mail Services.
CSE401N: Computer Networks Lecture-5 Electronic Mail S. M. Hasibul Haque Lecturer Dept. of CSE, BUET.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
Intro to Computer Networks Bob Bradley The University of Tennessee at Martin.
Review: –How do we address “a network end-point”? –What services are provided by the Internet? –What is the network logical topology observed by a network.
Application Layer Protocols Simple Mail Transfer Protocol.
The Linux Operating System Lecture 7: Tonga Institute of Higher Education.
1 Computer Communication & Networks Lecture 27 Application Layer: Electronic mail and FTP Waleed.
SMTP PROTOCOL CONFIGURATION AND MANAGEMENT Chapter 8.
Back to content Final Presentation Mr. Phay Sok Thea, class “2B”, group 3, Networking Topic: Mail Client “Outlook Express” *At the end of the presentation.
Webmail. Agenda Why use webmail? Why use webmail? What is webmail What is webmail – basic » system MDA MDA MTA MTA MUA MUA »Protocol SMTP SMTP.
FTP (File Transfer Protocol) & Telnet
ITI-481: Unix Administration Meeting 5. Today’s Agenda Network Information Service (NIS) The Cron Program Syslogd and Logging.
Simple Mail Transfer Protocol (SMTP)
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Application Layer Functionality and Protocols.
1 Using Messages sent from machine to machine and stored for later reading. You will use a client to read –Type mail or pine in UNIX to read.
What is and How Does it Work?  Electronic mail ( ) is the most popular use of the Internet. It is a fast and inexpensive way of sending messages.
File Transfer Protocol (FTP)
Linux+ Guide to Linux Certification, Second Edition Chapter 14 Network Configuration.
TELE 301 Lecture 10: Scheduled … 1 Overview Last Lecture –Post installation This Lecture –Scheduled tasks and log management Next Lecture –DNS –Readings:
1 Electronic Messaging Module - Electronic Messaging ♦ Overview Electronic messaging helps you exchange messages with other computer users anywhere in.
1 SMTP - Simple Mail Transfer Protocol –RFC 821 POP - Post Office Protocol –RFC 1939 Also: –RFC 822 Standard for the Format of ARPA Internet Text.
Application Layer Khondaker Abdullah-Al-Mamun Lecturer, CSE Instructor, CNAP AUST.
Module 5 Managing Message Transport. Module Overview Overview of Message Transport Configuring Message Transport.
Module 5 Managing Message Transport. Module Overview Overview of Message Transport Configuring Message Transport.
1 Periodic Processes and the cron Daemon The cron daemon is where all timed events are initiated. The cron system is serviced by the cron daemon. What.
LinxChix And Exim. Mail agents MUA = Mail User Agent Interacts directly with the end user  Pine, MH, Elm, mutt, mail, Eudora, Marcel, Mailstrom,
A Quick Look At How Works Understanding the basics of how works can make life a lot easier for any user. Especially those who are interested.
SMTP - Simple Mail Transfer Protocol RFC 821
CITA 310 Section 6 Providing Services (Textbook Chapter 8)
Slides based on Carey Williamson’s: FTP & SMTP1 File Transfer Protocol (FTP) r FTP client contacts FTP server at port 21, specifying TCP as transport protocol.
Linux Operations and Administration Chapter Twelve Configuring a Mail Server.
ITI-481: Unix Administration Meeting 5 Christopher Uriarte Rutgers University Center for Applied Computing Technologies.
COMP 431 Internet Services & Protocols
26.1 Electronic Mail Sending/Receiving Mail Addresses User Agent MIME Mail Transfer Agent Mail Access Protocols.
LINUXCHIX WEBMAIL. Software run by an ISP or online service that provides access to send, receive, and review using only your Web browser. Users.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
Application Layer instructors at St. Clair College in Windsor, Ontario for their slides. Special thanks to instructors at St. Clair College in Windsor,
Spring 2006 CPE : Application Layer_ 1 Special Topics in Computer Engineering Application layer: Some of these Slides are Based on Slides.
درس مهندسی اینترنت – مهدی عمادی مهندسی اینترنت برنامه‌نویسی در اینترنت 1 SMTP, FTP.
Understanding POP3 / IMAP Created by : Ashish Shah, J. M. Patel College of Commerce 1.
SMTP - Simple Mail Transfer Protocol POP - Post Office Protocol
Remote Logging, Electronic Mail, and File Transfer
System Administration
has many aspects that work together to give people almost instant communication from any computer on the internet to any other computer There.
Unit – 4 Chap - 2 Mail Delivery System
Chapter 7 Network Applications
Chapter 2 Application Layer
Presentation transcript:

ITI-481: Unix Administration Meeting 5 Christopher Uriarte Rutgers University Center for Applied Computing Technologies

Today’s Agenda Job Scheduling - The Cron Program Syslogd and Logging Sendmail and UNIX mail concepts

The Cron Program UNIX’s answer to automated job scheduling. Used to schedule jobs to run at particular time or at a particular frequency. Useful to to automate system administration tasks. Powered by a background system process called crond (the cron daemon) is started at boot time from rc scripts.

Cron Files Configuration files defining scheduled jobs are generally stored in the directory: /var/spool/cron The main Cron directory, where jobs defined according to username. These definition files are called crontab files.

Cron Files, con’t. Each user on the system can have a corresponding crontab file specifying their own automated job schedule – including root. The simple text files are kept under the /var/spool/cron directory, named after each user, e.g.: –/var/spool/cron/root –/var/spool/cron/chris –/var/spool/cron/mary –etc.

Crontab File Format Crontab files use the following format, placing one job entry on each line: Minute Hour Day Month DayOfWeek Command Time fields are as follows: –Minute (0-59) –Hour (0-23) –Day of Month (1-31) –Month (1-12 or names jan-dec –Day of Week (0-6 or names mon-fri) –Command: A command, script or program name to run at the time specified Fields that are not specified for a particular entry are substituted with “*” Ranges can be specified by placing a “-” between elements, such as “mon-fri”

Crontab File Formatting Rules Fields that are not specified for a particular entry are substituted with “*” –As you definitions for more fields, the execution time generally becomes more specific. Ranges of dates or times can be specified by placing a “-” between elements, such as “mon-fri” or “1-5” Multiple dates or times for a field can be specified by specified using a comma between values, such as “mon,wed,fri”, which will execute a job on Monday, Wednesday and Friday.

Sample Cron Entries Sample entries: #Ping our mail file server’s IP address every 15 min 0,15,30,45**** /sbin/ping – | /bin/mail root #Mail a disk usage report every Friday at 5:00PM 0 17 * * fri df |/bin/mail root Remember the format!: Minute Hour Day Month DayOfWeek Command

Editing Crontab files Although crontab files are simple text files, they cannot be edited by opening them directly with a text editor like vi,emacs,pico, etc. You must use the crontab program to edit a user’s crontab file: To use the crontab: > crontab –u username –e Crontab will open the specified crontab file in the default system editor (usually vi). You can have it use your favorite text editor by setting the EDITOR environment varialble (I.e. EDITOR=pico)

Editing Crontab files, con’t. When you have completed editing your crontab file, exit your text editor as your normally would. Be sure to save the file you’ve just created (the crontab program will give the file a default name and location) If you do not format your cron entry correctly, the cron program will notify you when you attempt to exit your editor. You will then have the chance to fix the entry or exit your editor (which leaves the crontab file unmodified)

/etc/crontab Defines a set of directories that will run scripts or links located in those directories at specified times. Predefined cron directories: /etc/cron.hourly /etc/cron.daily /etc/cron.weekly /etc/cron.monthly Non-standard way of using cron.

Exercise: Creating Crontab Entries Edit the root crontab file: > cd /var/spool/cron > crontab –u root -e Create a crontab entry to run out of the root account to a disk usage report to your internet.rutgers.edu account or another address of your choice every 15 minutes of the hour. Check /var/log/cron to verify that your job ran.

Syslogd Most system logging is handled through the syslogd. Configuration file is /etc/sylog.conf. Log entries are directed to various files in /var/log. Messages logged by syslogd include a time stamp, the process or facility that delivered the message, and the message itself. Rotating log files periodically is recommended.

/etc/syslog.conf Format of syslog rule: facility.priorityaction –facility - system or application generating the message. –priority – level of severity of the message. –Wild cards are accepted. Sample entries: authpriv.* /var/log/secure mail.err/var/log/maillog Tab delineated file. If changes are made need to restart syslog daemon: > kill –HUP `cat /var/run/syslog.pid`

Additional Log Files /var/run/utmp – information about who is currently logged into system. Used by commands such as who and finger. /var/log/wtmp – login times and duration for each user on the system. Can view with last command. /var/log/lastlog – similar to wtmp but used by different programs, such as finger.

Electronic Mail System Components Mail User Agent (MUA) –Provides interface for reading mail, writing new messages, and filing. Also called a mailer. –Examples: mail, Pine, Netscape Mail, Outlook. Mail Transport Agent(MTA) –Routes mail from one user to another either locally or across systems. –Uses a transport protocol, usually SMTP (Simple Mail Transport Protocol), to provide the medium for mail transfer. –Examples: Sendmail, Qmail. Mail Delivery Agent (MDA) –Takes a message once received at a site and gets it to the appropriate user mailbox. –Examples: procmail, mail.

Workstation POP ServerSMTP Server Mail Spool SMTP Server SMTP and POP Servers can be the same system Sending MailRetrieving Mail SMTP Relay SMTP Connection POP Connection Receiving Mail MUA MTA MDA MUA Sample Exchange: Sending, Receiving and Retrieving Electronic Mail

SMTP The SMTP protocol defines the method by which mail is sent from one host to another. SMTP usually uses port 25 – mail servers will be “listening” for incoming mail messages. No authentication required to use SMTP services – anybody can send mail without providing a username/password to send it.

Sample SMTP Exchange with a Mail Server amenti 5.5 [~] > telnet internet.rutgers.edu 25 Trying Connected to iti.Rutgers.EDU. Escape character is '^]'. 220 iti.rutgers.edu ESMTP Sendmail 8.9.3/8.8.7; Mon, 15 May :32: helo foobar.com 250 iti.rutgers.edu Hello amenti.rutgers.edu [ ], pleased to meet you mail from: 250 Sender ok rcpt to: 551 we do not relay rcpt to: 250 Recipient ok data 354 Enter mail, end with "." on a line by itself This is a test UAA03425 Message accepted for delivery

Exercise: Sending a Message Log into iti.rutgers.edu using ssh. Telnet to port 25 on your iti.rutgers.edu: > telnet iti.rutgers.edu 25 Compose and send out an message: helo foobar.com mail from: rcpt to: data This is a test.. ] Verify that your message was received: > less /var/spool/mail/youritiname Try reading the message in pine. type: > pine Access your inbox. What information about the message is hidden from the typical user view?

Sendmail Can be downloaded from Started from /etc/rc.d/init.d/sendmail at boot time. Responsible for sending and receiving messages. Once mail is received, it gets passed off to a MDA to deliver message to appropriate user mail box.

Sendmail Components /usr/sbin/sendmail Sendmail binary. Started by default with options –bd –q1h. Sendmail is started by an rc script when system boots. /etc/sendmail.cf Main configuration file. Defines rule sets that dictate Sendmail's behavior. Often also points to other sendmail configuration files in /etc. /etc/aliases or /etc/mail/aliases Used to create mailing lists or to give users alternative address. /var/spool/mqueue Queue for outgoing messages.

Receiving Electronic Mail The default storage location for incoming mail is /var/spool/mail/username. Mail can be redirected to other local or remote address through.forward files in user home directories or /etc/aliases on a system level.

Aliases File Entry format: username: newuser groupname: user1, user2 Sample enties: root: staff: kkaplan,jsmith,jdoe After editing /etc/aliases, for changes to take effect, need to run: > /usr/bin/newaliases

Exercise: Creating Aliases Add the following entries to /etc/aliases: root: student, Type: > /usr/bin/newaliases Verify that your aliases are working: > echo “checking aliases” |/bin/mail root > cat /var/spool/mail/student

Retrieving and Reading SMTP is a transport mechanism for sending mail only. An SMTP server will not allow a user to read or retrieve his/her mail. Options for reading or retrieving –Use a MUA to access directly the file system where the incoming mail is stored. –Post Office Protocol (POP) – permits mail to be downloading from a POP server to a POP client. –Internet Message Access Protocol (IMAP) – IMAP server maintains a central repository for IMAP account mail messages. Users can read, write, and file messages using an IMAP client.

POP3 Uses a server process to handle requests to retrieve . Usually uses port 110. Unlike SMTP, POP is an authenticated protocol. (users must provide a username and password to retrieve mail) Installed by default and enabled on most UNIX systems

IMAP Very similar to POP – however, not yet as popular. Uses a server process to handle requests to retrieve . Usually uses port 143. IMAP is an authenticated protocol. (users must provide a username and password to retrieve mail) Installed by default and enabled on most UNIX systems.

Job Scheduling in UNIX Sometimes its desirable to schedule an application or script to execute unattended at a certain time of day or at a certain frequency. –System backups (backup the /home filesystem to tape every night at 2:00am) –Scripts that check system files (check to see if the /etc/password and and /etc/shadow files have been changed in the last 24 hours and me if they have) –Scripts that mail reports or log files ( me the last 200 lines of the system security log every morning) UNIX administrators need a reliable way to schedule unattended jobs and, possibly, give users the ability to schedule unattended jobs.