Presentation is loading. Please wait.

Presentation is loading. Please wait.

System Administration. Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory:

Similar presentations


Presentation on theme: "System Administration. Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory:"— Presentation transcript:

1 System Administration

2 Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory: / When root changes its password, no prompt for exiting password. Root’s value for PATH –Never includes the current directory –Only includes /sbin or /user/sbin or both /sbin contains most administrative commands

3 Acquiring Superuser Privileges System adminstrator can acquire superuser privileges without using root login id by using su command: $ su – Password: ******** # Including - after su assures same environment as root. Omitting - after su assures environment of user account from which su is executed, e.g., user’s home directory su is also used by non-privileged users to become the superuser $ su – rbournique # need user login id To exit su mode, type exit or ctl-D

4 Add users and manage groups, e.g. change a user’s password Monitor and control system startup (boot) and shutdown Monitor and control the performance of system resources, e.g. Change the contents/ attributes of files, delete files, limit file sizes Initiate or kill any process except those necessary to run UNIX Control user access to scheduling services like at and cron Control access to networking services like ftp and remote login Perform backups (and restores) of critical files and data. Set or reset system clock Use wall command to broadcast messages to all users Kinds of Activities System Administrators Do

5 How System Administrators Do Their Job System administrators are super script writers !! Scripts are used to: Search through event and error logs Do nightly backup of drives and create archives Initiate scheduled maintenance Monitor CPU, network status Monitor free disk space crontab used to schedule administrative scripts

6 A group is a set of users having a separate set of privileges. Every user has a primary group and 1 or more supplementary groups. Commands for group are groupadd, groupdel and groupmod These commands edit entries in the file /etc/group GroupName:Passwd:GID_Num:GrpMemberLst 1st field: name of the group 2 nd field: generally not used 3 rd field: group number 4 th field: all users for whom this group is supplementary Example: staff::1: Group staff is group 1 and has no supplementary users in it. Managing Groups

7 Commands for managing users are useradd, userdel and usermod These commands edit entries in the file /etc/passwd UserName:Passwd:NumID:NumGID:Comment:HomeDir:Shell 1st field: name of the user 2 nd field: usually X, generally not used (shadow passwords) 3 rd field: numeric user ID 4 th field: numeric group ID (primary group) 5 th field: comment field (aka GCOS field) 6 th field: user’s home directory 7 th field: user’s default shell Example: rick:x:17:1:Bournique:/home/rick:/bin/sh Managing Users

8 Adding a User $ useradd –u 17 –g staff -c “Bournique” –d /home/rick –s /bin/sh –m rick Deleting a User userdel [-r] rick Modifying a User’s Password Entry usermod [-c comment] [ -d home dir ] [ -e expire date] [ -g group] [ -l login] [ -p passwd] [ -s shell] [ -u uid] rick User Command Usage

9 System state of UNIX is determined by its run level: 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 /S Single user mode (file system mounted). At each level, a distinct set of processes, scheduled to run. The init process controls the way UNIX is booted & powered down. On boot, init run level moves to 1 or s On shutdown, init run level moves to 0 or 6 UNIX Run Levels

10 init takes all its instructions from /etc/inittab file /etc/inittab contains instructions for what programs to run in each run level System administrator maintains /etc/inittab, e.g., insert entries for adding a new terminal to the system Administrator also issues shutdown command: issues wall to announce shutdown order to logoff sleeps for 1 minute sends signals to processes for normal termination logs off remaining users and kills processes unmounts all secondary file systems issues sync to write memory-resident data to disk Monitoring Start Up and Shutdown

11 System Resources That Need Performance Monitored CPU Utilization (monitoring fair allocation of time slices) Memory Utilization (context switching /swapping time and frequency) Disk space Usage I/O Time (amount of time spent moving data and servicing I/O requests) Network Usage Time Application Program Usage

12 Some UNIX Performance Monitoring Commands ps -display processes running in the system cron -perform process scheduling fsck - file system consistency check netstat -display network statistics nfsstat - display network file system (NFS) statistics time -display process’ CPU utilization df -display disk free report uptime -display system load average iostat -display input and output statistics vmstat -display memory, CPU, disk utilization reports

13 uptime : Report System Load Average # uptime 12:04am up 215 day(s), 8:37, 2 users, load average 0.11, 0.10, 0.12 Translation: Current time is 12:04 am, system has been up 215 days since 8:37; there are 2 users; five minutes ago load average was 0.11, ten minutes ago was 0.10 and fifteen minutes ago was 0.12.

14 vmstat : Virtual Memory Statistics General form: vmstat interval number Example: Show memory stats in 5 second intervals, 3 times # vmstat 5 3 procs memory page disk faults cpu r b w swap free re mf pi po fr de sr s0 s1 s2 s6 in sy cs us sy id 0 0 0 133136 13400 0 66 14 0 0 0 0 1 7 1 0 194 650 124 3 3 94 # procs (Processes) r Number of run-able processes during the interval. (excludes processes waiting or in I/O) bNumber of processes that are blocked waiting for I/O or other event. wNumber of processes that are swapped out. A non zero value means system was swapping

15 vmstat: Virtual Memory Statistics continued memory swap used swap space free available free swap space page pi 1 kb pages per second that have been paged in po 1 kb pages per second that have been paged out de anticipated short term memory shortfall disk s0, … number of disk operations per second on each disk drive faults in device interrupts per interval sy system calls per interval cpu cs CPU context switch rate us percentage of total CPU time spent in user state sy total CPU time spent in system state id percentage of total CPU time that CPU is idle

16 iostat: Disk Activity Statistics General Form: iostat [ ] [ ] Example: To have iostat show stats for all drives in 2 second intervals: # iostat 2 device bps sps msps c1t6d0 0 0.0 1.0 c1t3d0 0 0.0 1.0 # bps Average number of kilobytes per second during previous interval for disk. sps Average number of seconds per seek. msps Average number of milliseconds per seek.


Download ppt "System Administration. Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory:"

Similar presentations


Ads by Google