Linux Administration Odds and Ends

Slides:



Advertisements
Similar presentations
Working with Disks and Devices
Advertisements

Basic Unix system administration
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 12.
NETWORK FILE SYSTEM (NFS) By Ameeta.Jakate. NFS NFS was introduced in 1985 as a means of providing transparent access to remote file systems. NFS Architecture.
Joshua Caltagirone-Holzli
1 Network File System. 2 Network Services A Linux system starts some services at boot time and allow other services to be started up when necessary. These.
Linux Installation and Administration – Lesson 5 Tutor: George Papamarkos Topic: Devices in Linux.
Module 13: Configuring Availability of Network Resources and Content.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
1 Network File Sharing. 2 Module - Network File Sharing ♦ Overview This module focuses on configuring Network File System (NFS) for servers and clients.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
ITI-481: Unix Administration Meeting 5. Today’s Agenda Network Information Service (NIS) The Cron Program Syslogd and Logging.
CIS 191 – Lesson 2 System Administration. CIS 191 – Lesson 2 System Architecture Component Architecture –The OS provides the simple components from which.
Puppetize It! An Introduction to Puppet Mike Seda CEO, Seda Systems, Inc.
Linux Operations and Administration
Day 8 Exporting Displays Cronjobs Mount. Chapter 5 Chapter 5 talks about X windows. –You should read the chapter. –However, you do not need to pay particular.
Linux in a Virtual Environment Nagarajan Prabakar School of Computing and Information Sciences Florida International University.
TELE 301 Lecture 10: Scheduled … 1 Overview Last Lecture –Post installation This Lecture –Scheduled tasks and log management Next Lecture –DNS –Readings:
Chapter 6: Linux Filesystem Administration
Linux+ Guide to Linux Certification, Third Edition
Chapter Two Exploring the UNIX File System and File Security.
1 Objectives Manage and install new file systems.
Introduction to AFS IMSA Intersession 2003 AFS Servers and Clients Brian Sebby, IMSA ‘96 Copyright 2003 by Brian Sebby, Copies of these.
1 Week #10Business Continuity Backing Up Data Configuring Shadow Copies Providing Server and Service Availability.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
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.
Creating and Managing File Systems. Module 5 – Creating and Managing File Systems ♦ Overview This module deals with the structure of the file system,
Networking in Linux. ♦ Introduction A computer network is defined as a number of systems that are connected to each other and exchange information across.
Core 3: Communication Systems. Network software includes the Network Operating Software (NOS) and also network based applications such as those running.
Free Powerpoint Templates Page 1 Free Powerpoint Templates Users and Documents.
Linux Operations and Administration
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
1 COP 4343 Unix System Administration Unit 8: – at – cron.
PRESENTED BY ALI NASIR BITF13M040 AMMAR HAIDER BITF13M016 SHOIAB BAJWA BITF13M040 AKHTAR YOUNAS BITF13M019.
Lesson 9: SOFTWARE ICT Fundamentals 2nd Semester SY
Filesystem Management and Backups
Guide to Linux Installation and Administration, 2e
File System Implementation
CCNA Routing and Switching Routing and Switching Essentials v6.0
Chapter 9 Router Configuration (Ospf, Rip) Webmin, usermin Team viewer
System Programming and administration CS 308
lctseng / Liang-Chi Tseng Edit: yench
Chapter 9 Periodic Processes
Chapter 6 File Systems CSNB113 SYSTEM ADMINISTRATION
DHCP server & Client Objectives Contents
Automount NFS.
System Administration
Chapter 10: Device Discovery, Management, and Maintenance
CCNA Routing and Switching Routing and Switching Essentials v6.0
More Scripting & Chapter 11
Linux Administration Odds and Ends
Exploring the UNIX File System and File Security
Chapter 10: Device Discovery, Management, and Maintenance
IS3440 Linux Security Unit 4 Securing the Linux Filesystem
NFS.
Automount NFS.
SUSE Linux Enterprise Desktop Administration
Periodic Processes.
Chapter 9 Periodic Processes
Periodic Processes.
Automount NFS.
Periodic Processes Chapter 9.
Created By : Asst. Prof. Ashish Shah, J. M
Periodic Processes.
lctseng / Liang-Chi Tseng
Automounter Filesystem - autofs
Automount NFS.
RHCSA Study Prep.
Presentation transcript:

Linux Administration Odds and Ends Cron, YUM repo, and DHCP

Cron Cron daemon – controls periodic processes in the Linux system Reads one or more configuration files containing lists of command lines and times they are to run. crontab aka “cron table” – cron configuration file Cron wakes and sleeps every minute to check all configuration files, reloads any files that have changed, and executes any that are scheduled.

Cron locations Each user in the system can store their own cron file in /var/spool/cron System maintenance files located /etc/cron.d and /etc/crontab Generally /etc/crontab is the file sys admins change by hand /etc/cron.d is the location software packages can install crontab entires

Cron File Format # designates comments minute hour day month weekday [username] command First 6 fields separated by whitespace Username found only in /etc/crontab and /etc/cron.d

Cron details Each of the time-related fields may contain: A star, which matches everything A single integer, which matches exactly Two integers separated by a dash, matching a range of values A range followed by a slash and a step value, e.g., 1-10/2 (Linux only) A comma-separated list of integers or ranges, matching any value

Cron Examples 45 10 * * 1-5 Means to run every Monday through Friday at 10:45am 55 23 * * 0-3, 6 /staff/trent/bin/checkservers Means to run checkservers command everday at 11:55pm except Thursdays and Fridays

Crontab Management crontab filename installs filename as your crontab replacing any previous version. crontab arguments: e checks out a copy of your crontab for editing l lists crontab contents r removes crontab u username (used by root to edit or view a users crontab file) /etc/cron.allow and /etc/cron.deny If netiher file exists only root can submit crontabs

Common Uses for Cron Why would this be useful? Automated system backups Automated cleaning of tmp files or log files Automated system usage reports Automated reports of failed logins

Setup YUM Repo Mount the local media like CD, DVD, USB stick or ISO image that contains CentOS 7 / RHEL 7 / SL 7 / OL 7 to your PC. [root@localhost ~]# cd / [root@localhost /]# mkdir localrepo [root@localhost /]# cp -rv /media/* /localrepo/ (copy repos from disk image) [root@techbrown ~]# rm -rf /etc/yum.repos.d/* (this removes online repo)

Setup YUM Repo cont’d [root@localhost ~]# vim /etc/yum.repos.d/local.repo (add the following below to the local.repo file) [centos7] name=centos7 baseurl=file:///localrepo/ enabled=1 gpgcheck=0

Setup YUM Repo cont’d [root@localhost ~]# createrepo /localrepo/ [root@localhost ~]# yum clean all [root@localhost ~]# yum repolist all [root@localhost ~]# yum update

The Network File System Chapter 18 The Network File System

NFS NFS – not a video game! The Network File System (NFS) is a network protocol which allows one machine to access files stored on a second system.

NFS An NFS server system exports certain directory hierarchies from its local disc partitions. An NFS client system can then mount directories from that hierarchy as if they were filesystems stored on local disc. This requires a certain amount of cooperation between the two systems which are involved. An NFS client system inherits file ownerships and permissions from its server. If a particular user needs to access files on an NFS server, the UID and GID information for that user needs to be consistent on the two machines.

NFS NFS is designed to work across many different types of platforms. It is possible to export a directory from one type of Linux system and mount it on a second machine which is running an entirely different kind of Linux. Network filesystems should provide users with a seamless experience. Intended to be more or less transparent across networks.

NFS Daemons NFS client and server systems need to be running various system daemons before NFS will work reliably. NFS is an RPC based service, consequently the RPC portmapper must be running. They should also run the lockd and statd daemons for file locking to work reliably. File locking is used to guarantee exclusive access to a file.

Server Side NFS Running NFS sever on CentOS sudo service nfs start sudo service nfs status To add directories that the NFS server should allow others to mount over the network modify /etc/exports and then run /usr/sbin/exportfs -a

More on the exports file

And More

Server side NFS For example, the /etc/exports configuration /directory1 server.example.com(options) /directory2 192.168.1.0/24(options)

Client side NFS Before an NFS file system can be mounted, it must be properly exported on the server side. To verify that a server has properly exported its filesystems from the client’s perspective, use the client’s showmount command E.g. showmount –e <NFS server> Dash “e” tells the server to display its export list

Client Side NFS cont’ To mount filesystem: $ sudo mount -t nfs4 -o rw,hard,intr,bg host_name:mount location/ /(local mount point)

Client Side NFS cont’ You can check NFS mount with the df command You can also remove the mounted file system with the unmount –f command Add mounts that are part of a system’s permanent configuration in /etc/fstab automatically at boot time.

/etc/fstab The device name or other means of locating the partition or data source. The mount point, where the data is to be attached to the filesystem. The filesystem type, or the algorithm used to interpret the filesystem. Options, including if the filesystem should be mounted at boot. dump-freq adjusts the archiving schedule for the partition (used by dump). pass-num Controls the order in which fsck checks the device/partition for errors at boot time

nfsstat Dumps the output of statistics maintained by the nfs system Usage: nfsstat –[s/c] (s option is for server operations) (c is for client operations)

Dedicated NFS servers Stand alone hw that tends to be $$$ but has the following advantages: As storage requirements grow, they can scale smoothly to support terabytes of storage and hundreds of users. They are more reliable than stand-alone boxes thanks to their simplified software, redundant hardware, and use of disk mirroring. They usually provide file service for both Linux and Windows clients. Most even contain integrated web, FTP, and SFTP servers. They are often easier to administer than Linux file servers. They often include backup and checkpoint facilities that are superior to those found on vanilla Linux systems.

Automatic Mounting Configuring /etc/fstab for many hosts in a large system is tedious Many clients trying to access a NFS server can cause problems if the server crashes Automount daemon to mount filesystems when they are referenced and to unmount them when they are no longer being used.

Automatic Mounting cont’ Also limit the number of mount points Transparent to the user Automount understands three different kinds of configuration files. (referred to as “maps”): direct maps, indirect maps, and master maps Direct and indirect maps provide information about the filesystems to be automounted. A master map lists the direct and indirect maps that automount should pay attention to.

Automount cont’ The default master map file is /etc/auto.master (example below) # Directory Map /harp /etc/auto.harp /- /etc/auto.direct

Important things we did not cover Email postfix sendmail procmail Sharing Network Files Kerberos LDAP NIS Hardening/Security http://web.nvd.nist.gov/view/ncp/repository