SlideServe
Menu
Préférences
© SlideServe · v2026

Unix Comp-145

aldona avatar
21 diapositives · 369 Views · Jul 28, 2014

This lecture provides an overview of fundamental Unix system administration concepts. Key topics include the scope of administrative operations, the use of superuser privileges, file management, and user account administration. Learners will understand commands for monitoring system performance, booting systems, working with control files such as /etc/passwd and /etc/group, and utilizing shell scripts for automation. By the end of the lecture, participants will gain insights into essential commands and privileges necessary for efficient Unix system administration.

Unix Comp-145 - slide 1
01 / 21Unix Comp-145
1 / 17

Télécharger la présentation

Unix Comp-145
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Unix Comp-145 Lecture 9: Introduction to System Administration Source: S. Das, “Your Unix: The ultimate Guide”, 2nd Edition, McGraw Hill, 2006Chapt 19 BROOKDALE COMMUNITY COLLEGE

  2. Shell Programming Basic scope of operations for Sys Admin Booting the system Block and raw devices Concepts in using Scripts to do Sys Admin Sys Admin Key Files Concepts and commands to monitor Sys Perf BROOKDALE COMMUNITY COLLEGE

  3. Basic Scope of Operations for Sys Admin • System Admin login id, a.k.aSuperuser (SU) • root • DefaultPS1prompt = # • Home directory is / • When root changes its password it does not ask for the exiting password. • Root’s value for PATH • Never includes the current directory • Only includes /sbinor/user/sbinor both • /sbincontains most administrative commands BROOKDALE COMMUNITY COLLEGE

  4. Basic Scope of Operations for Sys Admin (cont’d) Superuser can switch from normal user to superuser (SU) $ su – Password: ******** # Including Hyphen after su command assures same environment as root. Omitting hyphen after su assures environment of user account from which su is executed, e.g., home directory To exit su mode, type exitorctl-D BROOKDALE COMMUNITY COLLEGE

  5. Basic Scope of Operations for Sys Admin (cont’d) • su command used by non-privileged users must have user-id as argument • $ su – jmensing • Password: ******** • # • If successful, recreates jmensing’s environment BROOKDALE COMMUNITY COLLEGE

  6. Scope of Operations for Sys Admin: • Administrator Privileges • Can change the contents or attributes of any file (e.g., access permissions & ownership) • Can delete any file even if it is write protected by the owner. • Initiate or kill any process except those necessary to run the Unix environment. BROOKDALE COMMUNITY COLLEGE

  7. Scope of Operations for Sys Admin: • Administrator Privileges (cont’d) • Can execute the passwd command to change any user’s password without knowing the existing. • $ passwdhenry • Use date to set or reset system clock • $ date <mmddhhmmss> • Use wallcommand to broadcast messages to all users who are logged in • Can display content of a file • appears on terminal even if users chose to deny all messages BROOKDALE COMMUNITY COLLEGE

  8. Scope of Operations for Sys Admin: • Administrator Privileges (cont’d) • Limit max size of files that users are permitted to create [ulimit] • Control user access to scheduling services like at and cron • Control user access to many networking services like • $ftp # file transfer services • $ ssh# remote machine login service • $ ssh –f server1.brookdalecc.edu sleep 10 BROOKDALE COMMUNITY COLLEGE

  9. Scope of Operations for Sys Admin: • Management of control files (cont’d) • /etc/group • GroupName:Passwd:GID_Num:GrpMemberLst • File has 1 primary group • Plus, 1 or more supplemental groups • Contains 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: BROOKDALE COMMUNITY COLLEGE

  10. Scope of Operations for Sys Admin: • Management of control files (cont’d) • Adding a member to a group [groupadd] • GroupName:Passwd:GID_Num:GrpMemberLst • Inserts an entry in to /etc/group file • Used to add new users to the system • Each option represents a field in the passwdfile • Deleting a member from a group [groupdel] • Modifying a member in a group [groupmod] BROOKDALE COMMUNITY COLLEGE

  11. Scope of Operations for Sys Admin: • Management of control files (cont’d) • Syntax of /etc/passwdfile • root:*:0:0:Charlie &:/root:/bin/csh • User login name • Encrypted password (or x if shadow passwords are in use) • Numerical user ID (UID) • Default Numerical group ID (GID) • User’s full name (also known as the GECOS field) • Home directory • Default shell • NOTE: GECOS means General Electric Comprehensive Operating System. Attributeintroduced by AT&T Bell Labs because some of its early Unix systems used GCOS machines for print spooling and various other services. BROOKDALE COMMUNITY COLLEGE

  12. Scope of Operations for Sys Admin: • Management of control files (cont’d) • Add a user into /etc/passwdfile • $ useradd –u 210 –g dba -c :The RDBMS” –d /home/oracle –s /bin/ksh –m oracle • MUST PROVIDE ALL ATTRIBUTES FOR PASSWD FILE’S ENTRY. • USUALLY PUT IN A SHELL BROOKDALE COMMUNITY COLLEGE

  13. Scope of Operations for Sys Admin: • Management of control files (cont’d) • Deleting an entry from passwdfile [usrdel] • Deletes an entry, i.e., a user from the system • usrdel [-r] login • Modifying an entry in passwdfile [usermod] • Modifies some parameters of entry • usrmod [-ccomment] [-dhome_dir [ -m]] [-eexpire_date] [-finactive_time] [-ginitial_group] [-Ggroup[,...]] [-llogin_name] [-ppasswd] [-sshell] [-uuid [ -o]] [-L|-U] login BROOKDALE COMMUNITY COLLEGE

  14. System Boot Process • 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 • Maintains system at specific states and decides which process to run for each run level (state) • Parent of all system daemons that continuously runs is init . • Spawns a getty process for every terminal so that users can log in. • To reveal current run level value use who –r BROOKDALE COMMUNITY COLLEGE

  15. System Boot • On boot, initrun level moves to 1 or s • On shutdown, initrun level moves to 0 or 6 • Run Levels (states) – Distinct set of processes, mostly daemons scheduled to run in each state • 0 System shutdown • 1 System Admin mode (local file system mounted) • 2 Multi-user mode (NFS not available) • 3 Full multiuser mode • 5 Graphical environment mode in Linux • 6 Shutdown and reboot mode • S or S Single user mode (file system mounted). BROOKDALE COMMUNITY COLLEGE

  16. System Shutdown • $ shutdowncommand • On shutdown, executes wallto announce system shutting down and directive to log off. • Sleeps for 1 minute then: • Sends signals to all running processes so they can terminate normally • Logs user’s off and kills remaining processes • Unmounts all secondary file systems (usesunmountcommand) • Invokes sync to write all memory resident data to disk • Preserves integrity of filesystem • Notifies users to reboot or switch off, or moves sys to single user mode BROOKDALE COMMUNITY COLLEGE

  17. System Shutdown • shutdowncommand (cont’d) • shutdown [-krhp][-o [-n]] time [warning-message] • Command options • -r Shutdown and reboot at specified time • -h Shutdown and halt at specified time • -pSystem halted and power turned off • -kKick everyone off • Timetime at which shutdown occurs in relative(+number of minutes) or absolute time (yymmddhhmm) • Warning message • -g<num> overrides default sleep value – expressed in minutes – not on sodapop BROOKDALE COMMUNITY COLLEGE

  18. How INIT Controls The Sytem • Init takes all instructions from /etc/inittab • Controls the way the system is booted and powered down. BROOKDALE COMMUNITY COLLEGE

  19. How INIT Controls The System (Cont’d) • Syntax: label:runLevels:action:command • Typical file content • fs::sysinit:/sbin/rcSsysinit > /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 BROOKDALE COMMUNITY COLLEGE

  20. How INIT controls the sytem • How to read S2 entry: • For run levels 2 & 3, script to run /sbin/rc2 • Wait to complete before moving to other lines in this file • Log all messages in msglog • Other terms: • Respawn causes process to restart on termination. • Wait causes init to wait before continuing • Sysinit used for initializing system, may check for dirtiness of both file systems & active swap partitions, and sets hostname. • Initdefault – sets default system run level, e.g., 3 (full multiuser mode) BROOKDALE COMMUNITY COLLEGE

  21. Chapter 19 (Part 2) To Be Continued BROOKDALE COMMUNITY COLLEGE