John Carelli, Instructor Kutztown University

Slides:



Advertisements
Similar presentations
Va-scanCopyright 2002, Marchany Unit 8 – Solaris File Systems Randy Marchany VA Tech Computing Center.
Advertisements

Basic Unix system administration
Linux Booting Procedure
Chapter 2 Booting and Shutting Down Kim Grempler (Sections 2.0 to 2.3) Leon Dague (Sections 2.4 to 2.7)
Unix Refresher This presentation is an amalgam of presentations by Mark Michael, Randy Marchany and Ed Skoudis. I have edited and added material. Dr. Stephen.
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 12.
A Guide to Unix Using Linux Fourth Edition
Syslogd Tracking system events. Log servers Applications are constantly encountering events which should be recorded –users attempt to login with bad.
System Startup and Shutdown
Information Networking Security and Assurance Lab National Chung Cheng University Investigating Unix System.
Linux+ Guide to Linux Certification, Second Edition
Linux System Administration LINUX SYSTEM ADMINISTRATION.
Configuring Disk Quotas Linux System Administration To implement disk quotas, use the following steps: Enable quotas per file system by modifying /etc/fstab.
Linux Filesystem Management
Booting and boot levels
A Guide to Unix Using Linux Fourth Edition
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.
CIS 218 Advanced UNIX 1 User and System Information CIS 218.
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
TELE 301 Lecture 10: Scheduled … 1 Overview Last Lecture –Post installation This Lecture –Scheduled tasks and log management Next Lecture –DNS –Readings:
Day 11 SAMBA NFS Logs Managing Users. SAMBA Implements the ability for a Linux machine to communicate with and act like a Windows file server. –Implements.
Chapter 6: Linux Filesystem Administration
Backups, Logging, Troubleshooting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 – 8 is extra credit – Due Thursday.
Linux+ Guide to Linux Certification, Third Edition
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
Hands On UNIX II Dorcas Muthoni. Processes A running instance of a program is called a "process" Identified by a numeric process id (pid)‏  unique while.
Ch11: Syslog and Logfiles Presented by: Apichana Thiantanawat 06/11/02.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 9: Basic Linux Administration Chapter 11: System Administration: Core Concepts Chapter 16:
1 LINUX SECURITY. 2 Outline Introduction Introduction - UNIX file permission - UNIX file permission - SUID / SGID - SUID / SGID - File attributes - File.
Cosc 4750 Log files Logging policies Throw away all data immediately Reset log files at periodic intervals Rotate logs files, keeping data for a fixed.
1 © John Urrutia. All rights reserved. Chapter 15 System Administration.
System Administration – Part 2. Devices in UNIX are files: A device can be accessed with different file names All device files are stored in /dev or its.
Daemons Ying Zhang CMSC691X, Summer02. Outline  Introduction  Init and Cron  System daemons  Print daemons and NFS daemons  Time synchronization.
© 2006 ITT Educational Services Inc. Linux Operating System :: Unit 3 :: Slide 1 Downloading and Installing Software yum pirut Bit Torrent rmp.
CSCI 330 UNIX and Network Programming Unit XX: Linux Administration.
System Administration. Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory:
Filesystem Management and Backups. 2 Section Overview Devices and Files Filesystem Management Network Filesystems Backups.
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.
Managing Users CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
Memory management. Linux Memory Management Total memory available for processes = real memory + paging space - 1MB. First megabyte of real memory is used.
Linux Filesystem Administration
Getting Started with Linux
LINUX SYSTEM ADMINISTRATION
Configuring Disk Quotas
SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz
Filesystem Management and Backups
Guide to Linux Installation and Administration, 2e
...looking a bit closer under the hood
Cosc 4750 Log files.
System Programming and administration CS 308
Basic Commands ls cp ls –l (in detail format) echo ls –a
Chapter 11: Managing Users
Hands On UNIX AfNOG 2010 Kigali, Rwanda
Chapter 2: System Structures
Hands On UNIX AfNOG X Cairo, Egypt
Adding New Users, Storage, File System
(Chapter 2) John Carelli, Instructor Kutztown University
OPS235: Week 1 Installing Linux (Lab1: Investigations 4 - )
LINUX SYSTEM ADMINISTRATION
Linux Filesystem Management
Rootly Powers Chapter 3.
Adding New Users.
Configuring Disk Quotas
Presentation transcript:

John Carelli, Instructor Kutztown University carelli@kutztown.edu

/etc/passwd /etc/shadow NIS NIS+ LDAP user info – ID, group ID, home dir, shell, … /etc/shadow actual password (encrypted) NIS network information service (yellow pages) distribute sys info (user names…) across computers on a network NIS+ updated version from Sun eliminate duplication of config data across network LDAP Lightweight Directory Access Portocol industry standard protocol distribute information across an IP network (name, passwords, etc…)

Add A New User Default settings useradd [-u uid] [-o] [-g group] [-G group [, group, …] [-d home] [-m] [-k template] [-f inactive] [-r] [-p passwd] [-s shell] [-e expire] [-c comment] login Default settings useradd -D [-g group] [-b base] [-f inactive] [-e expire] login useradd –D to see default settings

usermod [-u uid] [-o] [-g group] [-G group [, group, …] usermod [-u uid] [-o] [-g group] [-G group [, group, …] [-d home] [-m] [-l new_login] [-f inactive] [-r] [-p passwd] [-s shell] [-e expire] [-c comment] login userdel [-r] login

root (superuser) daemon (system server processes/files) bin (owns system executable’s and files) sys (for Distributed File Services, DFS) lp (printers) adm (basic system functions) nobody (default for unprivileged operations) (more info here)

Primary group Secondary groups /etc/group - groups on system groups command get a listing user can change current group with newgrp groupadd [-g gid] group to add a new group (root)

root daemon sys tty bin adm lp mail uucp / nuucp nobody noaccess

backup from one machine label all tapes grandfather / father / son 3 backup cycles (ex: daily, weekly,monthly) avoids propagating an error secure backup tapes keep tapes off-site backup appropriately always check restore procedure periodically develop a tape life cycle

activity on filesystem capacity of dump device length of “dump window” amount of redundancy number of tapes available how far back you must be able to recover

dump / ufsdump (Solaris – unix file system dump) cpio packs data on tape more efficiently than tar skips bad spots on restore (tar dies) can span tapes dump / ufsdump (Solaris – unix file system dump) full vs incremental (0-9) info saved in /etc/dumpdate ufsdump N [u] [s length] [d density] [f dump_file] files_to_dump (files or a mount point)

mt [-f tape_device] command commands rew - rewind offl - offline (unload the tape) status - output status info on tape unit fsf [count] - forward space “count” files (i.e. jump ahead) restore [i] [x file_to_restore] [f tape_device]

Linux Device Names (disks) The first floppy drive is named /dev/fd0. The second floppy drive is named /dev/fd1. The first hard disk detected is named /dev/sda. The second hard disk detected is named /dev/sdb, and so on. The first SCSI CD-ROM is named /dev/scd0, also known as /dev/sr0. The partitions on each disk are represented by appending a decimal number to the disk name: sda1 and sda2 represent the first and second partitions of the first SCSI disk drive in your system.

Physically add drive Create entries in /devices and/or /dev mknod command can do this format the drive mkfs (make the file system) newfs a newer, friendlier, version Add entry to /etc/fstab (optional) contains info about how fs should be mounted

Record characteristics of a file system length of a disk block size and location of inode tables disk block map and usage information size of the cylinder groups other important parameters of the filesystem more info here: http://www.linfo.org/superblock

Disk Information Get information about available disks: df command Disk space usage df –aTh (more readable format) lsblk command useful info about block devices major/minor numbers, /dev name, mount point, … lsusb command (for usb devices) fdisk –l device ex: fdisk –l /dev/sda (need to be root)

mount [-r] [device] <directory> uses /etc/fstab to get disk info -r for read only mount -t type [device] <directory> specify the type of device mount [-f filesystem_types] “fake” – don’t actually mount anything see what mount is trying to do, or add entries to /etc/mtab (for previously mounted devices) mountall called during boot process

umount <filesystem> umountall

Who is using a filesystem? fuser [-u] [-k] <device> -u for user -k kills the process using the device! -v is verbose Checking a filesystem fsck careful with this one! [-p] [-n] [-y] [-F filesystem_type] [raw_device]

fixes damaged or inconsistent inodes unreferenced inodes large link counts unused data blocks not recorded in block maps data blocks listed as free but also used in a file incorrect summary info in superblock

Set up user quotas (limits on disk space usage) rq in /etc/fstab (normally rw) create a quotas file in the affected filesystem edquota [-p prototype_user] <user> quota

Network File System - allows access over a network (looks like local storage) - runs on top of RPC protocol (Remote Procedure Call) Daemons nfsd, automountd, statd, lockd, nfslogd more info here /etc/exports - specifies exported file systems and hosts permitted to access them

Loading and initialization of kernel Device detection and configuration Creation of system processes Operator intervention (manual boot only) Execution of startup scripts (by init) Multiuser operation (init spawns getty process)

Also known as run levels  0 system is completely shut down  1 single-user mode (administration)  2 multi-user mode without NFS (networking)  3 full multi-user mode with networking  4 unused  5 full multi-user mode with networking and X11 (GUI)  6 reboot startup scripts defined in /etc/rc#.d commands in /etc/rc.local will execute at the end of the boot process

setting the name of the computer setting the time zone checking the disks with fsck mounting the system’s disks removing old files in /tmp configuring network interfaces starting up daemons and network services

logs shutdown kills nonessential processes executes sync waits for filesystem writes to complete halts the kernel

shutdown [TIME] [message] halt reboot [-p] (-p is poweroff) init <run_level> generally run by kernel or, restart with the given runlevel

flushes cached superblocks to disk flushes modified inodes and cached data blocks

Updates to system files Correct errors or provide security fix patch

CD Download source code Download package

yum apt-get

Configuration file: yum.conf yum install <packageName> Install package and dependency packages yum update [<packageName>] Without package name, updates all installed packages yum check-update Lists available updates for installed packages yum clean all Removes all header files used for resolving dependencies and cached packages yum list available Lists all available packages yum search <word> Searches for word in package description, summary, packager, and name Groups of packages yum grouplist yum groupinfo Yumdownloader Configuration file: yum.conf

apt-get update Update local package list apt-get check Check status of local dependency tree apt-get install <package> apt-get remove <package> apt-get upgrade Upgrade all packages on the system that don’t require any new packages apt-get dist-upgrade Upgrade all packages on the system and install any new packages necessary

A background process that performs a specific function or system-related task

SYSLOGD - system logging Syslog – standardized system for managing system log files programs write to the special file /dev/log syslogd reads messages from this file consults configuration file syslog.conf dispatches each message to appropriate destination sysadmin should back up and maintain log files Common Log Files /var/log/messages /var/log/auth.log /var/log/kern.log /var/log/cron.log /var/log/maillog /var/log/httpd /var/log/boot.log /var/log/mysqld.log /var/log/utmp /var/log/wtmp /var/log/yum.log

SYSLOGD – facility names kern user mail daemon auth lpr uucp cron mark local0-7 syslog authpriv ftp news  * The kernel User processes (default) sendmail and other mail-related software System daemons Security/authorization related commands The BSD line printer spooling system Reserved for UUCP (doesn’t use it) The cron daemon Timestamps generated at regular intervals Local messages syslogd internal messages Private authorization messages The ftp daemon, ftpd news service All facilities except mark

Panic situations (can also use panic) Urgent situations Critical conditions Other error conditions (can also use error) Warning messages (can also use warning) Things that might merit investigation Information messages For debugging only no priority all priorities emerg alert crit err warn notice info debug none  *

a daemon that manages other daemons Consults config file to determine which network ports to listen to Uses /etc/services or portmap daemon to map service names to port numbers

time 1 service name 2 type of socket service uses (stream or dgram) 3 communication protocol service uses (tcp or udp) 4 wait: service can process multiple requests at one time nowait - fork a new copy of daemon for each request 5 username under which daemon should run 6 fully qualified pathname of the daemon and its command-line arguments

a daemon that manages port assignments for daemons that use RPC (Remote Procedure Call) Analogous to a function call across machines

Report on virtual memory usage Two arguments number of seconds between measuring and reporting values number of times to measure and report values Report First line will be average values since last system reboot Other lines represents current values man vmstat

Report on network connection information Common options netstat –v netstat –nt netstat –nl netstat –I netstat –rn netstat -s