Unix Comp-145 L ECTURE 9: I NTRODUCTION TO S YSTEM A DMINISTRATION S OURCE : S. D AS, “Y OUR U NIX : T HE ULTIMATE G UIDE ”, 2 ND E DITION, M C G RAW H.

Slides:



Advertisements
Similar presentations
Unit 5 – User Administration Randy Marchany VA Tech Computing Center.
Advertisements

Linux Users and Groups Management
Basic Unix system administration
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
U NIX C OMP -145 L ECTURE 1: C ONCEPTS OF THE UNIX O PERATING S YSTEM S OURCE : S. D AS, “Y OUR U NIX : T HE ULTIMATE G UIDE ”, 2 ND E DITION, M C G RAW.
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.
Chapter 2 Accessing Your System and the Common Desktop Environment.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 2 Manage User Access and Security.
System Startup and Shutdown
Linux+ Guide to Linux Certification, Second Edition
Linux System Administration LINUX SYSTEM ADMINISTRATION.
U NIX C OMP -145 L ECTURE 5: UNIX P ROCESSES T EXT : S. D AS, “Y OUR U NIX : T HE ULTIMATE G UIDE ”, 2 ND E DITION, M C G RAW H ILL, /22/2009 rwjBROOKDALE.
Linux Filesystem Management
Booting and boot levels
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.
Unix System Administration Rootly Powers Chapter 3.
Managing User Accounts. Module 2 – Creating and Managing Users ♦ Overview ► One should log into a Linux system with a valid user name and password granted.
Adding New Users User as an entity - username(UID), GID. UID - typically a number for system to identify the user. GID – a number that recognizes a set.
ITI-481: Unix Administration Meeting 3. Today’s Agenda Hands-on exercises with booting and software installation. Account Management Basic Network Configuration.
IT2204: Systems Administration I 1 6b). Introduction to Linux.
U NIX C OMP -145 L ECTURE 6: C USTOMIZING THE S HELL E NVIRONMENT T EXT : S. D AS, “Y OUR U NIX : T HE ULTIMATE G UIDE ”, 2 ND E DITION, M C G RAW H ILL,
Module 4 - File Security. Security Overview File Ownership Access to Files and Dircetories Changing File and Directory Ownership Changing File and Directory.
Linux+ Guide to Linux Certification, Third Edition
Managing Users Objectives Contents Practicals Summary
File Permission and Access. Module 6 File Permission and Access ♦ Introduction Linux is a multi-user system where users can assign different access permission.
ITI-481: Unix Administration Meeting 3 Christopher Uriarte, Instructor Rutgers University Center for Applied Computing Technologies.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
Users Greg Porter V1.0, 26 Jan 09. What is a user? Users “own” files and directories Permission based on “ownership” Every user has a User ID (UID) 
System Startup & Shutdown
There are three types of users in linux  System users: ?  Super user: ?  Normal users: ?
Managing Users  Each system has two kinds of users:  Superuser (root)  Regular user  Each user has his own username, password, and permissions that.
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:
Introduction to System Admin Sirak Kaewjamnong. 2 The system administration’s job  Adding a new user  Doing backup and restoring files from backups.
Managing Users Objectives –to be able to add, modify and remove Unix user accounts Contents –requirements for a user account –configuration files (passwd,
Fall 2011 Nassau Community College ITE153 – Operating Systems Session 21 Administering User Accounts and Groups 1.
1 © John Urrutia. All rights reserved. Chapter 15 System Administration.
Λειτουργικά Συστήματα - Lab1 Γιάννης Πετράκης. The Operating System  Unix is a layered operating system  The innermost layer is the hardware that provides.
Linux Based Networks University of Education Instructor: Muhammad Amer Irshad.
The Saigon CTT Chapter 10 Managing Users. The Saigon CTT  Objectives  Define the requirements for user accounts  Explain group and group accounts 
Manually Creating a New User Account Presented by Carl South.
ITI-481: Unix Administration Meeting 3 Christopher Uriarte, Instructor Rutgers University Center for Applied Computing Technologies.
System Administration. Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory:
Lecture – Users and groups
Working with users and Groups. 1. Manage users and group 2. Manage ownership, permissions, and quotas.
Linux Use the Command-Line Interface to Administer the System.
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
SUSE Linux Enterprise Desktop Administration Chapter 9 Manage Users, Groups, and Permissions.
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Experiment No 4 Prepared by, Mr. Satish Pise. Objectives View the /etc/passwd file and describe its syntax. View the /etc/shadow file and describe its.
This slide deck is for LPI Academy instructors to use for lectures for LPI Academy courses. ©Copyright Network Development Group Module 14 Managing.
System Administration Startup Process. Why Care? ● Every process on your system comes about by following a specific chain of events from the machine startup.
The Linux Kernel About 6 million lines of code
LINUX SYSTEM ADMINISTRATION
SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz
System Programming and administration CS 308
Basic Commands ls cp ls –l (in detail format) echo ls –a
Chapter 11: Managing Users
UNIX System Overview.
Chapter 4 Booting and Shutdown
Chapter 2 User Management
Linux Users and Groups Management
Adding New Users, Storage, File System
Unix : Introduction and Commands
LINUX SYSTEM ADMINISTRATION
System & Network Administration (MCSA & RHCSA)
Module 13 System and User Security
Linux Filesystem Management
Adding New Users.
Presentation transcript:

Unix Comp-145 L ECTURE 9: I NTRODUCTION TO S YSTEM A DMINISTRATION S OURCE : S. D AS, “Y OUR U NIX : T HE ULTIMATE G UIDE ”, 2 ND E DITION, M C G RAW H ILL, 2006 C HAPT 19 BROOKDALE COMMUNITY COLLEGE111/19/2009 rwj

BROOKDALE COMMUNITY COLLEGE2 S HELL P ROGRAMMING B ASIC SCOPE OF OPERATIONS FOR S YS A DMIN B OOTING THE SYSTEM B LOCK AND RAW DEVICES C ONCEPTS IN USING S CRIPTS TO DO S YS A DMIN S YS A DMIN K EY F ILES C ONCEPTS AND COMMANDS TO MONITOR S YS P ERF 11/19/2009 rwj

BROOKDALE COMMUNITY COLLEGE3 B ASIC S COPE OF O PERATIONS FOR S YS A DMIN S YSTEM A DMIN LOGIN ID, A. K. A S UPERUSER (SU) – root – D EFAULT PS1 PROMPT = # – H OME DIRECTORY IS / W HEN ROOT CHANGES ITS PASSWORD IT DOES NOT ASK FOR THE EXITING PASSWORD. R OOT ’ S VALUE FOR PATH – N EVER INCLUDES THE CURRENT DIRECTORY – O NLY INCLUDES /sbin OR /user/sbin OR both /sbin CONTAINS MOST ADMINISTRATIVE COMMANDS 11/19/2009 rwj

B ASIC S COPE OF O PERATIONS FOR S YS A DMIN (cont’d) S UPERUSER CAN SWITCH FROM NORMAL USER TO SUPERUSER (SU) $ su – Password: ******** # I NCLUDING H YPHEN AFTER su COMMAND ASSURES SAME ENVIRONMENT AS ROOT. O MITTING HYPHEN AFTER su ASSURES ENVIRONMENT OF USER ACCOUNT FROM WHICH su IS EXECUTED, E. G., HOME DIRECTORY T O EXIT su MODE, TYPE exit OR ctl-D BROOKDALE COMMUNITY COLLEGE411/19/2009 rwj

BROOKDALE COMMUNITY COLLEGE5 B ASIC S COPE OF O PERATIONS FOR S YS A DMIN (cont’d) SU COMMAND USED BY NON - PRIVILEGED USERS MUST HAVE USER - ID AS ARGUMENT $ su – jmensing Password: ******** # I F SUCCESSFUL, RECREATES JMENSING ’ S ENVIRONMENT

BROOKDALE COMMUNITY COLLEGE6 C AN CHANGE THE CONTENTS OR ATTRIBUTES OF ANY FILE ( E. G., ACCESS PERMISSIONS & OWNERSHIP ) C AN DELETE ANY FILE EVEN IF IT IS WRITE PROTECTED BY THE OWNER. I NITIATE OR KILL ANY PROCESS EXCEPT THOSE NECESSARY TO RUN THE U NIX ENVIRONMENT. 11/19/2009 rwj S COPE OF O PERATIONS FOR S YS A DMIN : A DMINISTRATOR P RIVILEGES

BROOKDALE COMMUNITY COLLEGE711/19/2009 rwj C AN EXECUTE THE PASSWD COMMAND TO CHANGE ANY USER ’ S PASSWORD WITHOUT KNOWING THE EXISTING. $ passwd henry U SE DATE TO SET OR RESET SYSTEM CLOCK $ date U SE wall COMMAND TO BROADCAST MESSAGES TO ALL USERS WHO ARE LOGGED IN –C AN DISPLAY CONTENT OF A FILE – APPEARS ON TERMINAL EVEN IF USERS CHOSE TO DENY ALL MESSAGES S COPE OF O PERATIONS FOR S YS A DMIN : A DMINISTRATOR P RIVILEGES (cont’d)

BROOKDALE COMMUNITY COLLEGE811/19/2009 rwj L IMIT MAX SIZE OF FILES THAT USERS ARE PERMITTED TO CREATE [ ulimit ] C ONTROL USER ACCESS TO SCHEDULING SERVICES LIKE at AND cron C ONTROL USER ACCESS TO MANY NETWORKING SERVICES LIKE $ ftp # file transfer services $ ssh # remote machine login service $ ssh –f server1.brookdalecc.edu sleep 10 S COPE OF O PERATIONS FOR S YS A DMIN : A DMINISTRATOR P RIVILEGES (cont’d)

11/19/2009 rwjBROOKDALE COMMUNITY COLLEGE9 /etc/group GroupName:Passwd:GID_Num:GrpMemberLst —F ILE HAS 1 PRIMARY GROUP —P LUS, 1 OR MORE SUPPLEMENTAL GROUPS —C ONTAINS GID ( BOTH NAME AND NUMBER ) root::0:root # root user’s supplementary group staff::1: bin::2:root,bin,daemon sys::3:root:bin,sys,adm lp::8:root,lp,adm student::100: users:*:30: S COPE OF O PERATIONS FOR S YS A DMIN : M ANAGEMENT OF CONTROL FILES ( CONT ’ D )

BROOKDALE COMMUNITY COLLEGE1011/19/2009 rwj Adding a member to a group [ groupadd ] GroupName:Passwd:GID_Num:GrpMemberLst —I NSERTS AN ENTRY IN TO / ETC / GROUP FILE —U SED TO ADD NEW USERS TO THE SYSTEM —E ACH OPTION REPRESENTS A FIELD IN THE passwd FILE Deleting a member from a group [ groupdel ] Modifying a member in a group [ groupmod ] S COPE OF O PERATIONS FOR S YS A DMIN : M ANAGEMENT OF CONTROL FILES ( CONT ’ D )

11/19/2009 rwjBROOKDALE COMMUNITY COLLEGE11 S YNTAX OF /etc/passwd FILE root:*:0:0:Charlie &:/root:/bin/csh o User login name o Encrypted password (or x if shadow passwords are in use) o Numerical user ID (UID) o Default Numerical group ID (GID) o User’s full name (also known as the GECOS field) o Home directory o Default shell NOTE:GECOS means General Electric Comprehensive Operating System. Attribute introduced by AT&T Bell Labs because some of its early Unix systems used GCOS machines for print spooling and various other services. S COPE OF O PERATIONS FOR S YS A DMIN : M ANAGEMENT OF CONTROL FILES ( CONT ’ D )

BROOKDALE COMMUNITY COLLEGE1211/19/2009 rwj A DD A USER INTO /etc/passwd FILE $ useradd –u 210 –g dba -c :The RDBMS” –d /home/oracle –s /bin/ksh –m oracle o MUST PROVIDE ALL ATTRIBUTES FOR PASSWD FILE’S ENTRY. o USUALLY PUT IN A SHELL S COPE OF O PERATIONS FOR S YS A DMIN : M ANAGEMENT OF CONTROL FILES ( CONT ’ D )

11/19/2009 rwjBROOKDALE COMMUNITY COLLEGE13 D ELETING AN ENTRY FROM passwd FILE [ usrdel ] –Deletes an entry, i.e., a user from the system – usrdel [-r] login M ODIFYING AN ENTRY IN passwd FILE [ usermod ] –Modifies some parameters of entry – usrmod [-c comment] [ -d home_dir [ -m ]] [ -e expire_date] [ -f inactive_time] [ -g initial_group] [ -G group[,...]] [ -l login_name] [ -p passwd] [ -s shell] [ -u uid [ -o ]] [ -L|-U ] login S COPE OF O PERATIONS FOR S YS A DMIN : M ANAGEMENT OF CONTROL FILES ( CONT ’ D )

BROOKDALE COMMUNITY COLLEGE1411/19/2009 rwj Controlled by automated shell scripts After hardware is powered on, system looks for peripherals towards loading kernal into memory. Kernal spawns init (PID=1) which 1.Maintains system at specific states and decides which process to run for each run level (state) 2.Parent of all system daemons that continuously runs is init. 3.Spawns a getty process for every terminal so that users can log in. To reveal current run level value use who –r S YSTEM B OOT P ROCESS

11/19/2009 rwjBROOKDALE COMMUNITY COLLEGE15 O N BOOT, init RUN LEVEL MOVES TO 1 or s O N SHUTDOWN, init RUN LEVEL MOVES TO 0 or 6 R UN L EVELS ( STATES ) – D ISTINCT SET OF PROCESSES, MOSTLY DAEMONS SCHEDULED TO RUN IN EACH STATE 0S YSTEM SHUTDOWN 1S YSTEM A DMIN MODE ( LOCAL FILE SYSTEM MOUNTED ) 2M ULTI - USER MODE (NFS not available) 3F ULL MULTIUSER MODE 5G RAPHICAL ENVIRONMENT MODE IN L INUX 6S HUTDOWN AND REBOOT MODE S or SS INGLE USER MODE ( FILE SYSTEM MOUNTED ). S YSTEM B OOT

11/19/2009 rwjBROOKDALE COMMUNITY COLLEGE16 $ shutdown COMMAND O N SHUTDOWN, EXECUTES wall TO ANNOUNCE SYSTEM SHUTTING DOWN AND DIRECTIVE TO LOG OFF. S LEEPS FOR 1 MINUTE THEN : 1.S ENDS SIGNALS TO ALL RUNNING PROCESSES SO THEY CAN TERMINATE NORMALLY 2.L OGS USER ’ S OFF AND KILLS REMAINING PROCESSES 3.U NMOUNTS ALL SECONDARY FILE SYSTEMS ( USES unmount COMMAND ) 4.I NVOKES SYNC TO WRITE ALL MEMORY RESIDENT DATA TO DISK 5.P RESERVES INTEGRITY OF FILE SYSTEM 6.N OTIFIES USERS TO REBOOT OR SWITCH OFF, OR MOVES SYS TO SINGLE USER MODE S YSTEM S HUTDOWN

BROOKDALE COMMUNITY COLLEGE1711/19/2009 rwj shutdown COMMAND ( CONT ’ D ) shutdown [-krhp][-o [-n]] time [warning-message] C OMMAND OPTIONS -r S HUTDOWN AND REBOOT AT SPECIFIED TIME -h S HUTDOWN AND HALT AT SPECIFIED TIME -p S YSTEM HALTED AND POWER TURNED OFF -k K ICK EVERYONE OFF Time TIME AT WHICH SHUTDOWN OCCURS IN RELATIVE (+number OF MINUTES ) or ABSOLUTE time (yymmddhhmm) Warning message -g OVERRIDES DEFAULT SLEEP VALUE – EXPRESSED IN MINUTES – not on sodapop S YSTEM S HUTDOWN

11/19/2009 rwjBROOKDALE COMMUNITY COLLEGE18 I NIT TAKES ALL INSTRUCTIONS FROM /etc/inittab C ONTROLS THE WAY THE SYSTEM IS BOOTED AND POWERED DOWN. H OW INIT C ONTROLS T HE S YTEM

11/19/2009 rwjBROOKDALE COMMUNITY COLLEGE19 S YNTAX : label:runLevels:action:command T YPICAL FILE CONTENT fs::sysinit:/sbin/rcS sysinit > /dev/msglog 2 <>/dev/msglog </dev/console is:3:initdefault: s0:0:wait:/sbin/rc0 > /dev/msglog 2 <>/dev/msglog </dev/console s1:1:respawn:/sbin/rc1 > /dev/msglog 2 <>/dev/msglog </dev/console s2:2:wait:/sbin/rc2 > /dev/msglog 2 <>/dev/msglog </dev/console s3:3:wait:/sbin/rc3 > /dev/msglog 2 <>/dev/msglog </dev/console s6:6:wait:/sbin/rc6 > /dev/msglog 2 <>/dev/msglog </dev/console H OW INIT C ONTROLS T HE S YSTEM (C ONT ’ D )

11/19/2009 rwjBROOKDALE COMMUNITY COLLEGE20 H OW TO READ S2 ENTRY : o F OR RUN LEVELS 2 & 3, SCRIPT TO RUN / SBIN / RC 2 o W AIT TO COMPLETE BEFORE MOVING TO OTHER LINES IN THIS FILE o L OG ALL MESSAGES IN msglog O THER TERMS : oR ESPAWN CAUSES PROCESS TO RESTART ON TERMINATION. oW AIT CAUSES INIT TO WAIT BEFORE CONTINUING oS YSINIT USED FOR INITIALIZING SYSTEM, MAY CHECK FOR DIRTINESS OF BOTH FILE SYSTEMS & ACTIVE SWAP PARTITIONS, AND SETS HOSTNAME. oI NITDEFAULT – SETS DEFAULT SYSTEM RUN LEVEL, E. G., 3 ( FULL MULTIUSER MODE ) H OW INIT CONTROLS THE SYTEM

11/19/2009 rwjBROOKDALE COMMUNITY COLLEGE21 C HAPTER 19 (P ART 2) T O B E C ONTINUED